RosettaCodeData/Task/Closures-Value-capture/Scheme/closures-value-capture-3.ss
2023-07-01 13:44:08 -04: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)