【SICP练习】56 练习2.24-2.26

简介:


练习2.24

其打印结果为:(1 (2 (3 4)))

 

练习2.25

(define x ‘(1 3 (5 7) 9))

(cadr (caddr x))

;Value: 7

(define y ‘((7)))

(caar y)

;Value: 7

(define z ‘(1 (2 (3 (4 (5 (6 7)))))))

(cadr (cadr (cadr (cadr (cadr (cadrz))))))

;Value: 7

 

练习2.26

(define x (list 1 2 3))

(define y (list 4 5 6))

(append x y)

;Value: (1 2 3 4 5 6)

(cons x y)

;Value: ((1 2 3) 4 5 6)

(list x y)

;Value: ((1 2 3) (4 5 6))

目录
相关文章

热门文章

最新文章