[Grace-core] Traits as non-objects
James Noble
kjx at ecs.vuw.ac.nz
Mon Mar 18 00:34:14 PDT 2013
> I promised to write up a description of (my interpretation of) the trait inheritance proposal from Denver. Here it is. The file is in NewOOL/GracePaper/Traits/NonObject Traits
indeed! thanks for doing that. A few comments/questions:
- how does this work with modules?
in particular -
how do you inherit/instantiate a trait in another module?
modules & dialects now have to inherit from traits -
or not be extensible via inheritance
- do we want trait aliases / definitions
trait NumberSet = trait Set<Number>
- can object constructors have "naked" declarations -
or are declarations now only in traits?
- I'm pretty sure Eiffel's rename (and I imagine Marco's work) "deeply" renames methods..
- Do you still run initialisers for deleted fields?
- what's on the right-hand-side of a "-" operator?
- if we decide we want trait composition (not really a question)
it seems the proposal on trait composition operators is orthogonal to the proposal
about traits per se. With any of proposals, we could allow trait composition
(e.g. in inherits clauses),
- or have single inheritance
- or the Newspeak (and now Dart) model of implicit mixins...
- the conceptual model of traits seems to require at least one
extra concept - traits - without eliminating anything.
objects are still created by factory.new (rather than new X or object X?)
so we have the complexity of factories and classes, now with traits.
- alternatively couldn't you just make do with classes?
(with or without (orthogonal) composition operators)
I'm sorry if it comes across as being picky: but we just haven't
thought through most of the designs
I fear we'll end up talking about this again tomorrow:
actually I don't mind we're talking about it but we should just
do the other stuff first.
James
More information about the Grace-core
mailing list