RosettaCodeData/Task/Closures-Value-capture/Scheme/closures-value-capture-3.scm
2024-10-16 18:07:41 -07: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)