sicp

sicp sandbox.
git clone git://git.ricketyspace.net/sicp.git
Log | Files | Refs

commit 533743ec841f9f8f0d56f1e345e1ceac6406f56a
parent d3e3134b15f55329760ac92e09d08738ab97cfbf
Author: rsiddharth <s@ricketyspace.net>
Date:   Sat, 20 Jul 2019 12:18:50 -0400

sicp.org: Add excercise 29.d

Diffstat:
sicp.org | 30++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+), 0 deletions(-)

diff --git a/sicp.org b/sicp.org @@ -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