[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: categorizing traits objects
> >>>>> "self" == self <self@ifki50.informatik.fh-muenchen.de> writes:
>
> >> 2. All parents now have the same priority. This resulted in a
> >> vast simplification of the semantics of "resend".
>
> self> What happens if an object has two parents, each parent with
> self> a slot named equaly?
>
> I second this!
> At least, change the slot search to breadth search. That has always
> seemed to make more sense to me, in the context of finding the
> `closest' slot.
If more than one slot is found, you get a "message ambiguous" error
(just as you would in 2.0.1 if parents have equal priority).
We decided against including any "guess" about which slot is "closer"
in such situations because we have been bitten too many times by
conflict resolution rules which don't always do the right thing. That
is, even if a rule "usually" works that's not really good enough
because if it doesn't work you often get bugs that are hard to find
since the program may continue running for quite a while until
something finally breaks.
Without priorities, the language is indeed less expressive. For
example, it is hard to do mixins. However, we thought it was worth
giving up a little bit of expressiveness in exchange for a simpler
(and less surprising) language.
-Urs
PS: For backwards compatibility, there's actually a well-hidden VM
primitive that turns on prioritized inheritance...but it certainly
won't be there in future versions.