[Oberon] [EXT] Re: Potential New Approach to Implement Instance-Centered OOP in Oberon-07
August Karlstrom
fusionfile at gmail.com
Sun Oct 11 12:32:39 CEST 2026
On 2026-10-10 02:33, Chris Burrows wrote:
> Nothing needs to be added to the Oberon-07/language/. The 2016 Language
> Report already allows TYPE PObject = POINTER TO RECORD x, y, ...END;
>
> However, Wirth's /implementation/ for the Project Oberon compiler has a
> restriction that requires you to split this into two separate declarations:
>
> TYPE PObject = POINTER TO PObjectDesc;
> PObjectDesc = RECORD x, y, ...END;
>
> Once again ChatGPT was very useful in discussing why Wirth might have
> decided that this restriction was an expedient one. Anybody who is
> considering removing the restriction should be aware of the potential
> issues that may arise and the test cases that would be required:
>
> https://chatgpt.com/share/6ac98682-24b8-83ec-a077-494b64612c0e <https://
> chatgpt.com/share/6ac98682-24b8-83ec-a077-494b64612c0e>
In the thread ChatGPT says
"In Oberon-07, a record extension identifies its base using a record
type identifier, not a pointer type identifier.
Consequently:
ExtendedDesc = RECORD (P)
is illegal."
On the other hand, in section 26.1 of "An Oberon Compiler for the ARM
Processor" Niklaus Wirth says
"Again, the rules of Oberon help with an abbreviation. It is, for
example, possible to specify, using P0 instead of R0
TYPE P0 = POINTER TO RECORD a, b: INTEGER END
TYPE P1 = POINTER TO RECORD (P0) c, d: INTEGER END
"
https://people.inf.ethz.ch/wirth/Oberon/Oberon.ARM.Compiler.pdf
/August
More information about the Oberon
mailing list