[plt-scheme] pseudo statics

Jens Axel Søgaard jensaxel at soegaard.net
Wed Jul 1 19:06:24 EDT 2009


Hi Hugh,

2009/7/1 Hugh Myers <hsmyers at gmail.com>

> 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?


Is this it?

http://schemecookbook.org/Cookbook/IdiomSharingState

-- 
Jens Axel Søgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090702/748af935/attachment.htm


More information about the plt-scheme mailing list