Traits traits

nicolas.pelletier3 at free.fr nicolas.pelletier3 at free.fr
Fri Sep 24 12:22:28 PDT 2004


"Brian T. Rice" <water at tunes.org> writes:

>
> This is a good analysis. Thanks especially for the diagram to explain
> what the problem is to people.

You are welcome.   I was drawing it for inclusion  in the tutorial, as
an illustration for a paragraph  on the use of inspect.slate. I'll use
another part of the graph instead.

> We might do this, but what we're leaning towards lately is to make
> traits a special slot (like the map is special), so that it is treated
> differently by the lookup procedure (basically only to follow the
> first traits link and none after that). This effectively alters the
> diagram so that traits links are all "directional" (say, vertical
> where the rest are diagonal or horizontal). This would also pretty
> much make traits relationships required, so it would alter the
> language a bit, but the benefit of clarifying inheritance from basic
> delegation certainly outweighs it.
> 
> What do you think?

I like this idea very much.  There is already a need for object/traits
pairs, so I agree specializing  the traits slot to express inheritance
explicitly is  a win. An additional  benefit is that it  will make the
top of  the delegation  graph easier to  grasp, since  the inheritance
relationship  is  taken  care  of  in a  separate  place  (the  lookup
algorithm).

I am looking forward to using it ;-)

-- 
Nicolas




More information about the Slate mailing list