[Oberon] [EXT] Re: Potential New Approach to Implement Instance-Centered OOP in Oberon-07
Diego Sardina
dsar at eml.cc
Mon Oct 12 18:06:00 CEST 2026
An interesting (implicit) feature of just having extensible records (and not pointers) is the ability to prevent extension outside module boundaries, having a sort of a *final* class (by using a modern terminology).
TYPE
Foo* = POINTER TO FooDesc
FooDesc = RECORD ... END;
We can use instances of Foo but we can't extend FooDesc because it's not exported. We can't even allocate it (outside its declaring module) because the size of the record is not known (although it's exported for GC purposes, but that's a trick, for this reason implementations allow for NEW on those instances).
LIMITED records In Component Pascal exhibit exactly this behaviour. Indeed in Component Pascal they wanted to make it explicit with a keyword (even in the case you export the record or pointer, since you can extend a pointer directly in Component Pascal).
--
Diego Sardina
More information about the Oberon
mailing list