transcendental-lisp/fitnesse/FitNesseRoot/LispInterpreter/LexicalClosures.wiki

10 lines
301 B
Plaintext
Raw Normal View History

---
Test
---
2017-03-02 16:36:23 -05:00
A simple lexical closure.
2017-03-03 15:06:49 -05:00
| script | lisp interpreter fixture |
| show | evaluate | (defun adder-x (x) (lambda (y) (+ x y))) |
| show | evaluate | (setf adder-20 (adder-x 20)) |
| check | evaluate | (funcall adder-20 2) | 22 |