merits of Lisp vs Python
André Thieme
address.good.until.2006.dec.22 at justmail.de
Mon Dec 11 12:34:36 EST 2006
Fred Gilham schrieb:
> Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:
>
>> André Thieme <address.good.until.2006.dec.22 at justmail.de> 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é
--
More information about the Python-list
mailing list