merits of Lisp vs Python

Fred Gilham gilham at snapdragon.csl.sri.com
Mon Dec 11 11:38:54 EST 2006


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.

-- 
Fred Gilham                                  gilham at csl.sri.com
One of the authors of the Daniel Bell volume says, in horror and
astonishment, that the radical right intends to repeal the twentieth
century. Heaven forfend! Who would want to repeal the twentieth
century, the century of horror, the century of collectivism, the
century of mass destruction and genocide, who would want to repeal
that!                                           -- Murray Rothbard



More information about the Python-list mailing list