Fred Gilham schrieb: > Paul Rubin <http://[EMAIL PROTECTED]> writes: > >> André Thieme <[EMAIL PROTECTED]> writes: >>> Instead of function = memoize(function) >>> one could just say: memoize(function). >> In Python you'd say >> >> @memoize >> def function(): ... > > But in Lisp you'd write the function, say, "Damn, I need to memoize > this sucker," and evaluate > > (memoize 'function) > > and the function would be memoized. > > I suspect you could even do this "while the program was running" from > something like SLIME. Basically the memoize macro changes the > function cell of the symbol, so from that point all the calls to the > function would be to the memoized version. >
You don't even need to say 'function (memoize function) would be enough. And yes, you can memoize functions while the program is running. And you don't need a tool like slime for it. Lisp already offers ways for doing that. André -- -- http://mail.python.org/mailman/listinfo/python-list