[plt-scheme] pseudo statics
You want to reason (formally) about such invariants? Take a look at
POPL '06. There is a paper by Koutavas and Wand on just this point.
On Jul 1, 2009, at 6:36 PM, Hugh Myers wrote:
> 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
>>
>>