[Grace-core] Early experience with traits not overriding superobject

James Noble kjx at ecs.vuw.ac.nz
Thu Mar 10 01:58:23 PST 2016


> And if there were, it would be illegal, since graceObject is not fresh.

graceObject should be fresh (if we have one) 

It's still not clear to me how much of this is about the default methods vs other things,
Self (as I recall, haven't checked recently) pushes the "default methods" right to the top of the hierarchy.

more to the point, I don't know the hierarchy you're working with. 

part of me wants to say: if it hurts, perhaps don't do it that way.
If you only used traits (Fortress style, right?)
then you wouldn't have the "override for free" option:
ideally there would only be one trait defining each method in the composition.

If the superclass is abstract, and doesn't have state, then it's a trait.
could you just swap the inherit and use clauses around 
so what was the superclass comes in as a trait either without default methods 
(my design) or with them but they get excluded via the meet rule (which I thought was your design)

yes, being symmetric here pushes us more towards a "pure trait" approach with less overriding
and more composition of finer-grained traits.  Isn't that a good thing?

J 


More information about the Grace-core mailing list