[self-interest] representation extension by data parents?
Jecel Assumpcao Jr
jecel at merlintec.com
Mon May 23 19:17:33 UTC 2005
x19290 wrote on Mon, 23 May 2005 10:31:54 -0000
> I read a paper "Organizing Programs Without Classes" and
> very much interested in
> "Figure 3. Representation extension in a classless language."
> So I wrote a program implementing the figure but It did not work
> because there seemed to be two paths to copy methods,
> one through traitsParent* and another through dataParent*
> How can I resolve this problem or what must I read?
You have run into the most significant change to the language after that
paper was written in 1991. Figure 3 depended on what was called the "tie
breaker rule" which allowed the system to automatically select one from
several methods of the same name as being the right one. Unfortunately
this didn't work out very well as it was often not easy to figure out
which one the language would pick, making this a source of hard to find
bugs. In Self 3.0 this complication was eliminated at the cost of making
programs such as the one in the figure illegal. Running it will result
in the "ambiguous message" error.
It isn't easy to see how to rewrite the example program so that it would
work but it isn't so hard to avoid having this situation arise in the
first place in practice. Normal Self code has at most one parent object
that in turn inherits from more behavior ("traits") and all of the other
parents are stripped down and independent packages called "mixins".
Note that in figure 8 you will see a related feature that was also
eliminated from Self 3.0 - parent priorities. This worked with the tie
breaker rule by tagging some parent slots as more important than others
with extra "*" characters at the end of the name. These were searched
first and only when a slot wasn't found there did the search move on to
lower priority parents. This was also a source of confusion and so the
simplification was made. The need to break down long lists of slots into
more understandable units remained, however, so annotations were
introduced and the graphical outliner tools were created to work with
A third related feature not mentioned in this paper was also eliminated
at that time - slot privacy declarations. Actually the declarations
remained but the language now just ignores them.
More information about the Self-interest