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

10 lines
321 B
Plaintext

---
Test
---
A simple lexical closure.
| script | lisp interpreter fixture |
| show | evaluate text | (defun adder-x (x) (lambda (y) (+ x y))) |
| show | evaluate text | (setf adder-20 (adder-x 20)) |
| check | evaluate text | (funcall adder-20 2) | 22 |