]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex3_12.rkt
Lazy version of evaluator and tests.
[sicp.git] / src / sicp / ex3_12.rkt
1 #lang r5rs
2
3 (define (append! x y)
4   (set-cdr! (last-pair x) y)
5   x)
6
7 (define (last-pair x)
8   (if (null? (cdr x))
9       x
10       (last-pair (cdr x))))
11
12 #|
13
14 x => a -> b -> ()
15 y => c -> d -> ()
16
17 (cdr x) => (b->()) => (b)
18
19 w => (a->b->c->d->()) and
20 x => (a->b->c->d->())
21
22 (cdr x) => b->c->d->() (b c d)
23    
24 |#