(define (square x)
(* x x))
(define (f x y)
(define (f-helper a b)
(+ (* x (square a))
(* y b)
(* a b)))
(f-helper (+ 1 (* x y))
(- 1 y)))
(f 1 2)
(define (f-lambda x y)
((lambda (a b)
(+ (* x (square a))
(* y b)
(* a b)))
(+ 1 (* x y))
(- 1 y)
)
)
(f-lambda 1 2)
(define (f-let x y)
(let ((a (+ 1 (* x y)))
(b (- 1 y)))
(+ (* x (square a))
(* y b)
(* a b))))
(f-let 1 2)
(define x 5)
(+ (let ((x 3))
(+ x (* x 10)))
x)
(define x 2)
(let ((x 3)
(y (+ x 2)))
(* x y))
let赋值域变量不能从另一个获得
转载于:https://www.cnblogs.com/R4mble/p/7894002.html
相关资源:JAVA上百实例源码以及开源项目