Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只是在学习计划,但我希望能够少重复自己。
有没有办法可以为本地范围内的子表达式分配名称?
根据评论:
Haskell where 子句
x = s * t where s = 10 t = 20
在这种情况下,x 应该是 200。
Let(或 letrec 用于递归绑定),例如:
(define (f g) (let ((x 1) (y (* g 2))) (+ x y)))