Would Anonymous Functions Help in Learning Programming/Python?
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Sat Sep 22 07:15:53 EDT 2007
On Sat, 22 Sep 2007 02:44:35 -0700, Kay Schluehr wrote:
> I checked out Io once and I disliked it. I expected Io's prototype OO
> being just a more flexible variant of class based OO but Io couples a
> prototype very closely to its offspring. When A produces B and A.f is
> modified after production of B also B.f is modified. A controls the
> state of B during the whole lifetime of B. I think parents shall not
> do this, not in real life and also not in programming language
> semantics.
Well it's like Python: inherited slots (attributes) are looked up in the
ancestors. It should be easy to override `Object clone` in Io, so all
slots of the ancestor are shallow copied to the clone, but I guess this
might break existing code. At least for your own code you could introduce
a `realClone` slot.
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list