Re: [Chicken-users] Memoizing a procedure

2010-11-29 Thread F. Wittenberger
Am Montag, den 29.11.2010, 13:53 +0100 schrieb Jörg F. Wittenberger: Hi Hugo, Am Sonntag, den 28.11.2010, 17:27 +0100 schrieb Peter Bex: On Sun, Nov 28, 2010 at 12:53:53PM -0300, Hugo Arregui wrote: Hi guys, (define (make-memoized proc) (let ((memo (make-hash-table)) (missing

Re: [Chicken-users] Memoizing a procedure

2010-11-29 Thread F. Wittenberger
Am Montag, den 29.11.2010, 10:34 -0300 schrieb Stephen Eilert: So it is not only memoization, but a caching system. I was going to write something similar, to cache webservice responses. That it is. I've got several caches working with the attached code. The API is kind of patterned after

[Chicken-users] Memoizing a procedure

2010-11-28 Thread Hugo Arregui
Hi guys, I wrote a small code to add procedure memoization, most for learning purposes (attached). I'm glad to ear your suggestions. Also, I cheked advice egg, but I cannot find the way to reuse in this particular case. Thanks, Hugo. mem.scm Description: Binary data

Re: [Chicken-users] Memoizing a procedure

2010-11-28 Thread Peter Bex
On Sun, Nov 28, 2010 at 12:53:53PM -0300, Hugo Arregui wrote: Hi guys, Hi Hugo! I wrote a small code to add procedure memoization, most for learning purposes (attached). I'm glad to ear your suggestions. It looks good to me. It only works for simple procedures though, not for procedures

Re: [Chicken-users] Memoizing a procedure

2010-11-28 Thread Peter Bex
On Sun, Nov 28, 2010 at 05:27:29PM +0100, Peter Bex wrote: It looks good to me. It only works for simple procedures though, not for procedures with optional arguments or keyword arguments. And not for procedures returning zero or multiple values. Cheers, Peter -- http://sjamaan.ath.cx -- The

Re: [Chicken-users] Memoizing a procedure

2010-11-28 Thread Alan Post
On Sun, Nov 28, 2010 at 11:42:20PM -0300, Hugo Arregui wrote: Thanks for your comments Peter!, they are very interesting. It looks good to me.  It only works for simple procedures though, not for procedures with optional arguments or keyword arguments. Keyword args can be in any order,