Let Over Lambda

2020/10/29 00:33
阅读数 375

以下摘自LetOverlambda

  1. let over lambda (let ((counter 0)) (lambda (x) (1+ counter))
  2. lambda let over lambda (lambda () (let ((counter 0)) (lambda () (incf counter))))
  3. let over lambda over let over lambda (let ((direction 'up)) (defun toggle-counter-direction () (setq direction (if (eq direction 'up) 'down 'up))) (defun counter-class () (let ((counter 0)) (lambda () (if (eq direction 'up) (incf counter) (decf counter))))))
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部