; Shows a Scheme counterpart to lambda3.cc. Gives same output as lambda4.cc. (define (f seed0) (let ((seed seed0)) (lambda (i) (set! seed (+ 1 seed)) (+ i seed)))) (define g (f 5)) (map (lambda (a) (g a)) (list 1 2 3 4 5)) ; (7 9 11 13 15)