chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] procedure memoization


From: Kon Lovett
Subject: Re: [Chicken-users] procedure memoization
Date: Wed, 17 Feb 2010 18:14:55 -0800


On Feb 17, 2010, at 5:08 PM, Nicolas Pelletier wrote:

Hello,

On Sat, Feb 13, 2010 at 5:53 AM, Hugo Arregui <address@hidden> wrote:

there's a standard implementation for procedures memoization? Srfi or egg?

Not yet but check out the advice egg & 'around advice & you can roll- your-own.


R5RS says that the result of forcing a promise is memoized. So you
might want to do something along the lines of:

(let ((x (delay (begin (print "Hi!") 1)))) (print (force x)) (print (force x)))
Hi!
1
1

HTH,

--
Nicolas


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users

Best Wishes,
Kon






reply via email to

[Prev in Thread] Current Thread [Next in Thread]