Created
February 14, 2019 10:42
-
-
Save sudoankit/201ecd896c7d28db5aa4cddfff2a1248 to your computer and use it in GitHub Desktop.
My solution to Exercise 1.2 of SICP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Write the expression in prefix form. | |
;; | |
;; 5 + 4 + ( 2 - ( 3 - ( 6 + 4/5 ) ) ) | |
;; ------------------------------------- | |
;; 3 * ( 6 - 2 ) * (2 - 7 ) | |
;; | |
;; A: | |
;; ( / ( + 5 4 (- 2 (- 3 (+ 6 (/ 4 5 ) ) ) ) ) | |
;; ( * 3 (- 6 2 ) (- 2 7 ) ) ) | |
;; | |
1 ]=> ( / ( + 5 4 (- 2 ( - 3 ( + 6 ( / 4 5 ) ) ) ) ) | |
( * 3 ( - 6 2 ) (- 2 7 ) ) ) | |
;Value: -37/150 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment