[Grace-core] Considering Traits as Objects in Grace

Lex Spoon lex at lexspoon.org
Wed Mar 6 07:02:54 PST 2013


For handling super, I believe that the glue method approach will have
challenges in practice. Imagine you have a hierarchy like this, and
every class in the hierarchy has its own initialize method:

   A
 /   \
B   C
 \  /
  D

With the linearization approach, all the initialize methods will run
one time, in an order that is deterministic but kinda slippery.

With the glue method approach, class D needs to write a glue method,
but I don't see how to do it. The obvious thing to do is call
B.initialize followed by C.initialize, but in that case, A.initialize
is going to run twice.

Lex


More information about the Grace-core mailing list