SICP - Solution: Exercise 1.2

Sep 24, 2018 21:03 · 32 words · 1 minute read

Exercise 1.2: Translate the following expression into prefix form:

$${\frac{5+4+(2-(3-(6+\frac45)))}{3(6-2)(2-7)}.}$$

Solution

(/ (+ 5
      4
      (- 2
         (- 3
            (+ 6
               (/ 4 5)))))
   (* 3
      (- 6 2)
      (- 2 7)))