Jump to content

Closures/Value capture: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 728:
=={{header|Scheme}}==
 
<lang scheme>(define;;; (build-list-of-functionsCollecting nlambdas iin a tail-recursive list)function.
(define (build-list-of-functions n i list)
(if (< i n)
(build-list-of-functions n (+ i 1) (cons (lambda () (* (- n i) (- n i))) list))
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.