RosettaCodeData/Task/Closures-Value-capture/Scheme/closures-value-capture-3.ss
2015-11-18 06:14:39 +00:00

6 lines
162 B
Scheme

(define list-of-functions (map (lambda (x) (lambda () (* x x))) (iota 0 1 10)))
; print the result
(display
(map (lambda (n) (n)) list-of-functions)
(newline)