merits of Lisp vs Python
Robert Brown
bbrown at speakeasy.net
Mon Dec 11 22:25:59 EST 2006
Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:
> Espen Vestre <espen at vestre.net> writes:
>> > Can you redefine CLOS methods without calling CLOS functions that tell
>> > the object system what to expect (so it can do things like update the
>> > MRO cache)? I.e. can you redefine them by poking some random
>> > dictionary? You can in Python. I don't claim that's a good thing.
>>
>> Just as I said: Less managable, but not more dynamic.
>
> I'm not getting through to you. Yes, you could create a Python-like
> object system in Lisp that's separate from CLOS, but nobody would use
> it ....
I think you are not understanding the point that Espen is trying to make.
He is not suggesting a different object system for Lisp.
Espen is saying that Common Lisp often offers the same dynamic feature as
Python has, such as the ability to redefining a method at runtime. Lisp,
however, forces you to call a CLOS function or use an well defined interface
when redefining a method. You can't just change a value in a hash table.
Does this make Lisp "less dynamic" than Python? Espen would say it's not
less dynamic, but rather that a similar level of dynamism is achieved in
Common Lisp via well defined interfaces. The compiler knows the interfaces,
so it can do a better job optimizing the code.
More information about the Python-list
mailing list