]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex3_14.rkt
Merge branch 'master' of github.com:vu3rdd/sicp
[sicp.git] / src / sicp / ex3_14.rkt
1 #lang r5rs
2
3 #|
4
5 mystery is trying to find the reverse of the list x. Too lazy to draw the ascii art. 
6 Too lazy to scan my notebook.
7
8 |#
9
10 (define (mystery x)
11   (define (loop x y)
12     (if (null? x)
13         y
14         (let ((temp (cdr x)))
15           (set-cdr! x y)
16           (loop temp x))))
17   (loop x '()))