在看lichray介绍的fp,看到了sicp,好书呀,中文翻译的和原版都是好书,原书就很流畅.好读,可以下china-pub的样章,读下免费的第一章,scheme太牛了,前缀运算符,用()来分割块运算,终于知道lambda其实就是无名过程,和js匿名函数基本一个意思,不过()和前缀运算俯太牛了,写了些练习,使用DrScheme测试,函数式编程,或者说scheme编程就是重视算法和算子相结合的编程吧,lambda算子的匿名过程以及优美的前缀运算,几乎使我忘却了函数和基本数学运算符的区别,也许之间根本没区别吧,都是过程,这语言确实不一样
Welcome to DrScheme, version 371 [3m].
Language: Lazy Scheme.
> (define (square x) (* x x))
> (square 3)
9
> (square (square 2))
16
> (define (sum-of-square x y) (+ (square x) (square y)))
> (sum-of-square 2 3)
13
> (sum-of-square 2 4)
20
> ()
()
> (sum-of-square 3 4)
25
> (define (f a) (sum-of-square (+ a 1) (* a 2)))
> (f 2)
25
> (f )
. #<procedure>: expects 1 argument, given 0
> (> 7 9)
#f
> (< 7 9)
#t
> (define (aaa a b) (a b))
> (aaa (lambda (x) (* x x x)) 2)
8
>