|
|
@@ -49,6 +49,35 @@ NOTES (V3 implementation, m2compiler-V3):
|
|
|
a class BEGIN ... END init body runs once at startup (as
|
|
|
<Class>_init).
|
|
|
- Still 230: extra parents (multiple inheritance is out of scope).
|
|
|
+
|
|
|
+FUTURE WORK -- multiple inheritance (not planned; recorded for later):
|
|
|
+
|
|
|
+ Single inheritance is a deliberate choice; extra parents stay 230.
|
|
|
+ If MI is ever wanted, the cost is dominated by ONE thing: pointer
|
|
|
+ adjustment for upcasting to a non-first base.
|
|
|
+
|
|
|
+ * Tier 1 -- "multiple inclusion" (~1 day): CLASS C (A, B) lays out
|
|
|
+ A's fields then B's, and both sets of methods are callable as
|
|
|
+ obj.M, but you may only upcast along the FIRST parent
|
|
|
+ (POINTER TO B := c stays rejected). No pointer adjustment, so
|
|
|
+ the fixpoint stays a reliable guard. Mostly SymTab/QbeGen:
|
|
|
+ tparent -> a parent list (ParentCount/ParentAt), and
|
|
|
+ FindField / ClassMethodNode / IsSubclass / BuildVTable /
|
|
|
+ ComputeOffsets / TypeSizeD iterating the set; plus an ambiguity
|
|
|
+ check when two paths declare the same name (~10-15 functions).
|
|
|
+
|
|
|
+ * Tier 2 -- full MI with polymorphic upcasting (several days,
|
|
|
+ higher risk): adds address adjustment on every upcast (pointer
|
|
|
+ assignment, VAR/value actuals, =/#, NEW) and this-adjusting
|
|
|
+ thunks for virtual calls through a secondary base; also forces a
|
|
|
+ decision on DIAMONDS -- note CLASS Multi (Shape, Circle) below
|
|
|
+ IS a diamond (Circle already inherits Shape), needing shared-base
|
|
|
+ dedup or an outright rejection. Clarion reference semantics for
|
|
|
+ multi-parent classes are not fully specified here, so Tier 2
|
|
|
+ would partly be inventing semantics.
|
|
|
+
|
|
|
+ Recommendation: Tier 1 only if a real corpus needs multi-parent
|
|
|
+ inclusion; otherwise leave MI out.
|
|
|
|
|
|
|
|
|
|