[Grace-core] [less important] Classical Inheritance vs Delegation

Marco Servetto marco.servetto at gmail.com
Sat Mar 9 00:13:56 PST 2013


More than  accept classes to be no more objects
I would strongly argue for a generative (flattening) interpretation of
traits as the "only" way to have code reuse(without inheritance)

That is,

def foo=object{ uses <TraitExpression> .... }

where traits can be "non first class" set of methods
and classes can be defined as syntactic sugar as before,
and... NO need for conventional inheritance.
Structural typing is used for subtype, so inheritance here is not used
to "reuse the type"
Traits can be used to reuse the code, so... conventional inheritance
would have no more reason to exists.


More information about the Grace-core mailing list