merits of Lisp vs Python

Christophe chris.cavalaria at free.fr
Tue Dec 12 10:54:17 EST 2006


André Thieme a écrit :
> Paul Rubin schrieb:
>> André Thieme <address.good.until.2006.dec.22 at justmail.de> writes:
>>>> import module
>>>> module.function = memoize(module.function)
>>> Yes, I mentioned that a bit earlier in this thread (not about the
>>> "during runtime" thing).
>>> I also said that many macros only save some small bits of code.
>>> Your python example contains 4 tokens / brain units.
>>> The Lisp version only has 2.
>>
>> You shouldn't count the import statement, since you'd need the
>> equivalent in Lisp as well.
> 
> I didn't count it.
> 
> 1P) module.function
> 2P) =
> 3P) memoize(
> 4P) module.function)
> 
> vs
> 1L) (memoize
> 2L) function)
> 
> I counted 1P and 4P only as one (each) although it should have been 2
> for each. But it would have worked too if we didn't need the "module.":
> function = memoize(function).

If you really need to : memoize('module.function') but it's ugly.



More information about the Python-list mailing list