[Oberon] [EXT] Re: Potential New Approach to Implement Instance-Centered OOP in Oberon-07
Diego Sardina
dsar at eml.cc
Thu Oct 15 11:40:27 CEST 2026
> On 2026-10-13 02:03, Chris Burrows wrote:
>> His reply dated 13 Mar 2017 was:
>>
>> "You are right. The identifier R0 in
>>
>> RECORD (R0) a, b: INTEGER END.
>>
>> must be a record type, and cannot be a pointer type.
>>
>> I had "simplified" this some long time ago, because pointer types in
>> this position caused severe troubles in combination with import/export.,
>> And I think this "restriction" iis quite sensible. Unfortunately, the
>> diagnostic message is a bit obscure."
>
> OK, thank you for sharing the clarification. I still wonder what the
> severe trouble is.
>
> /August
I guess it's related to the problem of generating a symbol file in a single pass in the case of pointers that are forward references. You can read more in the Compiler Construction book or An Oberon Compiler for the ARM Processor (chapter 24. Import and Export), that you linked before. In the latter Wirth goes a bit deeper about it.
Regarding what he replied to Chris, I guess with *pointer types in this position* Wirth meant using a pointer (that is a forward reference) as a base record in the record declaration. Maybe he was talking about this pathological case below:
TYPE
P0 = POINTER TO T0;
P1 = POINTER TO RECORD (P0) ... END;
...
T0 = RECORD ... END;
(Of course we are always talking about doing everything in a single pass.)
--
Diego Sardina
More information about the Oberon
mailing list