diff options
author | rsiddharth <s@ricketyspace.net> | 2019-07-20 12:18:50 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2019-07-20 12:18:50 -0400 |
commit | 533743ec841f9f8f0d56f1e345e1ceac6406f56a (patch) | |
tree | ba1ce7e4b92e76fab7700c9e733c4e906235f285 | |
parent | d3e3134b15f55329760ac92e09d08738ab97cfbf (diff) |
sicp.org: Add excercise 29.d
-rw-r--r-- | sicp.org | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -544,3 +544,33 @@ creates a list with the squared numbers in a messy nested list like: (list x y) '((1 2 3) (4 5 6)) #+END_SRC +*** 29 +**** d +Everything needs to be changed! + +Initially, for =make-mobile=, it used be: + +#+BEGIN_SRC scheme +scheme@(guile-user)> (make-mobile (make-branch 5 50) (make-branch 5 50)) +$37 = ((5 50) (5 50)) +#+END_SRC + +Now (using =cons= instead of =list=) it is: +#+BEGIN_SRC scheme +scheme@(guile-user)> (make-mobile (make-branch 5 50) (make-branch 5 50)) +$58 = ((5 . 50) 5 . 50) +#+END_SRC + +Initially, for =make-branch=, it used be: + +#+BEGIN_SRC scheme +scheme@(guile-user)> (make-branch 5 (make-mobile (make-branch 3 50) (make-branch 3 50))) +$61 = (5 ((3 50) (3 50))) +#+END_SRC + +Now (using =cons= instead of =list=) it is: + +#+BEGIN_SRC scheme +scheme@(guile-user)> (make-branch 5 (make-mobile (make-branch 3 50) (make-branch 3 50))) +$60 = (5 (3 . 50) 3 . 50) +#+END_SRC |