函数式编程入门 lisp
#lang slideshow (define c (circle 10)) (define r (rectangle 10 20)) ;定义一个调用函数 (define (square n) (filled-rectangle n n)) ;局部绑定 (define (four p) (define two-p (hc-append p p)) (vc-append two-p two-p)) ;使用let进行绑定 (define (checker p1 p2) (let ([p12 (hc-append p1 p2)] [p21(hc-append p2 p1)]) (vc-append p12 p21)))