[Oberon] Potential New Approach to Implement Instance-Centered OOP in Oberon-07
Chris Burrows
cfbsoftware at gmail.com
Mon Oct 5 03:49:59 CEST 2026
I put your proposal to ChatGPT for analysis and the reply was generally
favourable:
https://chatgpt.com/s/t_6ac300bdf27c8191b3c26edf69adef88
On Sat, Oct 3, 2026 at 7:19 PM Andreas Pirklbauer <
andreas_pirklbauer at yahoo.com> wrote:
> The Oberon-2 programming language offers a convenient notation for
> object-oriented programming (OOP), namely that of type-bound procedures. It
> is valuable in education. However, Oberon-2 uses a class-centered view
> rather than an instance-centered view, meaning that Oberon-2-style
> type-bound procedures (methods) can essentially be viewed as constants: the
> same procedure is bound to all instances of a type. This reflects the
> reality that, in most typical applications, the same procedure (handler) is
> indeed bound to all instances of a class.
>
> One advantage of this approach is that a programmer cannot accidentally
> forget to initialize the method bindings. A disadvantage is that the
> bindings are fixed at the type level. This makes a new feature necessary,
> namely method overriding. This in turn complicates the language and the
> compiler and, in fact, the conceptual model. See an earlier discussion of
> this topic, “Class Methods vs. Procedure Variables in Records,” on this
> mailing list in 2017.
>
> The Graphics module provides an example where the alternative view, namely
> the instance-centered view, is implemented “manually”. This is done by
> declaring a method record and initializing its method fields manually in
> the module initialization body. This is somewhat cumbersome and requires
> some discipline from the programmer.
>
> This raises the question whether one could combine the two approaches with
> the following new construct:
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20261005/83e8d3bd/attachment.html>
More information about the Oberon
mailing list