[self-interest] parent arguments

Jecel Assumpcao Jr. jecel at merlintec.com
Tue Dec 13 05:13:07 UTC 2011


Jan-Paul Bultmann wrote:

> Sounds like differential inheritance to me. :?

I had to look that up, but then recognized the idea: instead of cloning
your prototype (as in Self) you create a child for it and only add to
the child the slots for which it has different values than the prototype
(as in Io or Newtonscript).

While parent arguments could be used like this, I was thinking more in
terms of composite objects where you have what seems to be a single
object to the rest of the world but inside it is built from several.
Another pattern I was thinking of is wrapper objects.

Perhaps this is a needless complication after all. My problem with
assignable parent slots is that you normally will change their value
once (right after cloning the prototype) and then leave it alone. Since
the system can't know it won't change again, it can't do the
optimizations that would be possible for a constant parent slot. I was
trying to have a way to tell the systems it is ok to do those
optmizations. But an equally valid alternative is to have the system
guess that the first assignment will be the only one and be prepared to
undo all optimizations if a second assignment happens.

-- Jecel




More information about the Self-interest mailing list