欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SICP学习笔记 2.3.1 引号 SICPLispScheme函数式编程 

程序员文章站 2022-05-28 21:49:26
...

    练习2.53

(a b c)
((george))
((y1 y2))
(y1 y2)
#f
#f
(red shoes blue socks)

 

    练习2.54

(define (equal? a b)
  (cond ((and (null? a) (null? b)) true)
	      ((null? a) false)
	      ((null? b) false)
	      (else (and (eq? (car a) (car b)) (equal? (cdr a) (cdr b))))))

 

    练习2.55

;; 'a 即为 (quote a)

1 ]=> (quote a)
;Value: a

;; 因此 ''abracadabra 等价于 (quote (quote abracadabra))

1 ]=> (quote (quote abracadabra))
;Value: (quote abracadabra)

1 ]=> ''abracadabra
;Value: (quote abracadabra)

1 ]=> (car (quote (quote abracadabra)))
;Value: quote