>> I guess I also shouldn't rely on the current behaviour of the SPAD compiler,
>> right?
> IIRC rules are: domain inheritance first, then tree of categories with
> depth-first search where order of arguments to Join gives order
> on parents.
Yes and the Join makes everything basically unpredictable for a user.
Clearly, the compiler has its rules, but as a user one gets surprises
when one expects one thing but the rules actually tell something else.
And why it should be left unspecified is, because one can have default
implementations in different categories and joins them, if there is
overlapping the rules may give you a definite implementation, but maybe
not the one that one would actually like.
I remember that long time ago I wanted to put lots of things into
category defaults, because then one could have inheritance from multiple
"domains". That works well as long as nothing overlaps. But overlapping
usually happens quite soon. So one has to find the right balance for
what to implement and what not. Category defaults should definitely not
be (ab)used to achieve multiple inheritance.
> It is probably not wise to depend on order being depth-first (people
> may change order of arguments to Join), but within linear inheritance
> chain order should be reliable.
The linear inheritance is actually what I wanted.
Now thinking a bit more then I was actually doubtful of something like this.
)abbrev domain DFOOBAR DFooBar
DFooBar: Join(FooCat, BarCat) == Bar
)abbrev domain DBARFOO DBarFoo
DBarFoo: Join(BarCat, FooCat) == Bar
But that should go always by the rule "domain implementation first" and
so both would be identical to Bar no matter what overlapping defaults
there are in the Join.
> Look at (sub)chapter 14.2.2 in the FriCAS book, there is part
> about search path. Also, Daventport article about Schratchpas II
> design gives a lot of details.
Well, I did and realized that the content does not agree with reality.
Or maybe I am not smart enough to find a button labelled "Linage".
Grepping through the FriCAS sources doesn't find anything for "Lineage".
Ralf