learning-sicp

My embarrassing half assed SICP run.
git clone https://kaka.farm/~git/learning-sicp
Log | Files | Refs

exercise-2.scm (498B)


      1 (define-library (sicp solutions chapter-1 exercise-2)
      2   (import (scheme base))
      3   (export expression)
      4 
      5   (begin
      6 
      7     #!
      8 
      9     *Exercise 1.2:* Translate the following expression into prefix
     10     form.
     11 
     12     5 + 4 + (2 - (3 - (6 + 4/5)))
     13     -----------------------------
     14     3(6 - 2)(2 - 7)
     15 
     16     !#
     17 
     18     (define expression
     19       (/ (+ 5
     20             4
     21             (- 2
     22                (- 3
     23                   (+ 6
     24                      (/ 4 5)))))
     25          (* 3
     26             (- 6 2)
     27             (- 2 7))))))