Suite 147/147; self-hosting fixpoint OK
(bootstrap/fixpoint.sh, image 2,313,762 bytes). master, tree
clean except the user's uncommitted compiler/toto.mod.
This session took Clarion CLASS from "declared + checked only, ends
in 230" to a complete single-inheritance object system with dynamic
dispatch — in four tagged steps, each re-verified against the
byte-identical fixpoint.
| Step | Tag | Commit | What |
|---|---|---|---|
CHAR-array + + ConvResults |
v3-charcat-convresults |
5e2056f |
(warm-up: string + test + ISO ConvResults) |
| Showcase 17 | v3-showcase17 |
807ff9c |
CLASS + strings + conversions together |
| CLASS lowering | v3-class-lowering |
ed02804 |
fields, methods, THIS, single inheritance |
| VIRTUAL dispatch | v3-virtual-dispatch |
98d3067 |
vtables + subtype pointers |
| Showcase 18 | v3-showcase18 |
f584e62 |
polymorphic Shape hierarchy |
| CLASS finished | v3-class-finish |
3804256 |
sibling calls + init body |
| Showcase 19 | v3-showcase19 |
9f1f278 |
init body + sibling-call chain |
v3-class-lowering)ComputeOffsets gives
declaration-order offsets; single inheritance lays the child's
fields after the parent's, and FindField/FieldOffset walk the
parent chain. obj.field and WITH obj reuse the record path.THIS VAR parameter,
pushed as the current WITH base, so a bare field name means
THIS^.field.obj.M(args) binds statically; the receiver is the
hidden first argument; CLASS IMPLEMENTATION reuses the declared
method symbol (matching call-site and definition uids).docs/summary_class-lowering.md.v3-virtual-dispatch)data $vt_<typeindex> = { l $Method_uid, … };
a declared-but-unimplemented method is l 0.POINTER TO Derived assign to
POINTER TO Base.docs/summary_virtual-dispatch.md.v3-class-finish)CLASS IMPLEMENTATION, a bare
method name is a call on THIS (chains work; a virtual sibling
still dispatches through the vtable).BEGIN … END init body — emitted as <Class>_init and
run once at startup.230 (single inheritance by design).docs/summary_class-finish.md.Showcase17 — a Bounded counter class + ConvResults +
CHAR-array + → showcase17 total=42.Showcase18 — Circle/Square with a virtual Area(), driven through
an array of POINTER TO Shape → showcase18 areas sum=139.Showcase19 — an init body setting a global plus a sibling-call
chain → showcase19 total=42.Added across the arc: t_charcat, convresults_prog (+ conv_prog/
showcase14 moved to IntVal/RealVal), t_classmethod,
t_classinherit, TClassDefProg (t_classdef.mod →
t_classdef.def), t_virtual, t_classsibling, t_classinit
(t_class promoted from reject), and Showcase17/18/19.
✅ fields, methods (value/VAR formals, results), single inheritance,
WITH, hidden THIS, VIRTUAL dynamic dispatch (vtables) with
subtype pointers, sibling calls, init bodies.
⏸ multiple parents only (deliberate).
cd .../m2compiler-V3
./bootstrap/fixpoint.sh # FIXPOINT OK
cd compiler && ./build.sh && ./run_tests.sh # 147/147
VAL(LONGINT|REAL, x) and long→int narrowing.SysClock, richer Strings/Math).Files/IOChan extras (seek/pool nuances), deeper variant-record
support.