Closures/Value capture: Difference between revisions

Content added Content deleted
(added simplified scheme solution)
(fixed scheme code to task accordance)
Line 1,186: Line 1,186:
list))
list))


(define list-of-functions (build-list-of-functions 11 1 '()))
(define list-of-functions (build-list-of-functions 10 1 '()))


(map (lambda (f) (f)) list-of-functions)
(map (lambda (f) (f)) list-of-functions)
Line 1,193: Line 1,193:


{{out}}
{{out}}
<lang scheme>(1 4 9 16 25 36 49 64 81 100)
<lang scheme>'(1 4 9 16 25 36 49 64 81)
81</lang>
81</lang>