SICP习题 1.1 (if cond语句)

(define a 3)

(define b (+ a 1))

b

(+ a b(* a b))

(= a b)

(if (and (> b a) (< b (* a b)))
b
a)

(cond ((= a 4) 6)
((= b 4) (+ 6 7 a))
(else 25))

(+ 2 (if(> b a) b a))

(* (cond ((> a b) a)
((< a b) b)
(else -1))
(+ a 1))

 

b既是一个变量,又是一个函数.有点神奇.

开始选择了Lazy Racket, b的值是delay.是正则序吗?

后来改成了R5RS, b的值就能正常显示了,有可能是应用序.

(require string-constants)
(set-language-pref 'simplified-chinese)
执行两行代码,然后重开

找到括号自动补全.嚯嚯嚯

中文upup

 

解题集:http://sicp.readthedocs.org/en/latest/

posted @ 2017-11-22 11:26  R4mble  阅读(277)  评论(0编辑  收藏  举报