sol*_*ent 4 scheme haskell racket
我只是在学习计划,但我希望能够少再重复一遍.
有没有办法可以为本地范围内的子表达式指定名称?
根据评论:
Haskell where子句
x = s * t
where s = 10
t = 20
Run Code Online (Sandbox Code Playgroud)
在这种情况下,x应为200.
设(或letrec用于递归绑定),例如:
(define (f g)
(let ((x 1) (y (* g 2)))
(+ x y)))
Run Code Online (Sandbox Code Playgroud)