gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does GM2 support ISO OOP extension?


From: Benjamin Kowarsch
Subject: Re: Does GM2 support ISO OOP extension?
Date: Wed, 25 Mar 2020 04:17:55 +0900



On Wed, 25 Mar 2020 at 04:03, Gaius Mulley <address@hidden> wrote:
Hưng Hưng <address@hidden> writes:

> I came from Object Pascal so I miss OOP very much. I checked and found
> there is one OOP extension for M2 from ISO. Please let me know if GM2
> supports it and where could I find documents about this ISO dialect.
> There is too litle information about it. I only know about this OOP
> extension from modula2.org without seeing the actual ISO papers.

Hi,

no gm2 doesn't support the OOP extension for M2,

Nor are they worth supporting.

First, there is very little support from other compilers.

Second, they were designed by committee compromise and it shows.

It would be less effort to implement Oberon-style extensible records instead.

https://github.com/m2sf/m2bsk/wiki/Language-Description#record-types

https://github.com/m2sf/m2bsk/wiki/Object-Oriented-Programming

We have thrown out variant records in favour of these, but it should be possible to accommodate both variant and extensible records in GM2 in PIM and/or ISO mode perhaps enabled with an option switch. Our syntax makes this possible as an extensible record type declaration must always specify a base type (unlike Oberon) and for root types the base type specifier is simply NIL. Thus, when there is no base type specified, the declaration is for a conventional (non-extensible) record for which the variant syntax could be preserved.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]