它的盒子图形如下:
(1 (2 (3 4))) ((2 (3 4)))
[*]---------------> [*]| || |v v (2 (3 4)) ((3 4))1 [*]---------------> [*]| || |v v (3 4) (4)2 [*]---------------> [*]---------------> '()| || |v v3 4
它的树图形如下:(1 (2 (3 4)))*/ \/ \ (2 (3 4))
1 */ \/ \ (3 4)2 */ \/ \3 4
习题2.5
(define x (list 1 3 (list 5 7) 9))
run:
Welcome to DrRacket, version 5.3.3 [3m].
Language: planet neil/sicp; memory limit: 512 MB.
> (car (cdr (car (cdr (cdr x)))))
7
>
#lang planet neil/sicp
(define x (list (list 7)))
run:
> (car x)
(mcons 7 '())
> (caar x)
7
>
(define x (list 1 (list 2 (list 3 (list 4 (list 5 (list 6 7)))))))
run:
> (car (cdr (car (cdr (car (cdr (car (cdr (car (cdr (car (cdr x))))))))))))
7
>