(* (+ 3 4) (- 9 (* 2 3))) ⇒ 21 - PREFIX form (evaluate '((3 + 4) * (9 - (2 * 3)))) ⇒ 21 - INFIX formevaluate worked by processing the expressions as an expression tree:
However,
(evaluate '((3 + 4) * 9 - 2 * 3))
will cause not work because evaluate
expects all expressions to be fully parenthesized 3-element lists.
But ((3 + 4) * 9 - 2 * 3) is mathematically legal.