Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!apple!bionet!agate!stew.ssl.berkeley.edu!ericco From: ericco@stew.ssl.berkeley.edu Newsgroups: comp.lang.scheme Subject: Counter in SIOD Message-ID: <1990Aug15.005252.8122@agate.berkeley.edu> Date: 15 Aug 90 00:52:52 GMT Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Reply-To: ericco@stew.ssl.berkeley.edu () Organization: University of California, Berkeley Lines: 20 I typed in the following into my freshly compiled version 2.4 of SIOD: > (define (cnt x) (lambda () (let ((y x)) (set! y (+ y 1))))) > (set! cnt1 (cnt 10)) > (cnt1) 11 > (cnt1) 11 Did I miss something in the recent discussion of this feature of scheme? Why doesn't the counter 'y' get incremented each on each call to the cnt1? Please send me mail, I know this has already been discussed here. Thanks, Eric Eric ericco@ssl.berkeley.edu