[plt-scheme] pseudo statics

From: Hugh Myers (hsmyers at gmail.com)
Date: Wed Jul 1 18:36:55 EDT 2009

Interesting reading, but not quite what I was asking about. If you
execute counter it will return a value one greater each time. This was
what I was asking about. I've need of a static variable and was
looking for code that provides the equivalent...

--hsm


On Wed, Jul 1, 2009 at 11:53 AM, Matthias Felleisen<matthias at ccs.neu.edu> wrote:
>
> HtDP, chapter VII (and VIII, and Intermezzo).
>
>
> On Jul 1, 2009, at 1:46 PM, Hugh Myers wrote:
>
>> Somewhere is a discussion about code like:
>>
>> (define counter
>>    (let ((a 0))
>>      (lambda ()
>>        (set! a (+ 1 a))
>>        a)))
>>
>> I just can't remember where! Anyone have any useful pointers or such?
>>
>> --hsm
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>


Posted on the users mailing list.