[Oberon] Intermediate scopes in Oberon-07
chris at cfbsoftware.com
Sat Feb 10 01:28:16 CET 2018
> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Andreas Pirklbauer
> Sent: Saturday, 10 February 2018 2:22 AM
> To: ETH Oberon and related systems
> Subject: [Oberon] Intermediate scopes in Oberon-07
> > I have been in contact with Prof. Wirth and he confirms
> > that "procedure Q should be diagnosed in error." Therefore,
> > access to any kind of object from an intermediate scope is
> > not allowed in Oberon-07/16. This holds true even for
> > parameter types as illustrated by the example above.
> This is as it should be. Thus, the current implementation just
> doesn’t implement it (as the example compiles without errors)
It is interesting to note that Project Oberon 2013 would compile without errors even if, and when, the compiler is updated to conform to the 2016 Report.
The PO2013 system consists of a total of approximately 850 procedures. I could only find 17 that were local procedures. Of those 17 I couldn't find a single example where the enclosing procedure had a TYPE or CONST declaration. That did not surprise me at all.
However, when I looked a bit further, what did come as a surprise was that I could find only ONE local TYPE declaration and only eight local CONST declarations (five of those in Math.Mod) in the entire system!
If these sorts of statistics were common to other current realworld Oberon applications it would be reasonable to ask whether not only local PROCEDUREs, but also local TYPEs, are really *needed*.
All of these features were *absolutely essential* in the Pascal days when all you had was a single PROGRAM file. But since the introduction of MODULEs in Modula-2 and the simplification of TYPEs in Oberon they have become less and less significant.
... or would that be a case of making it simpler than "as simple as possible"?
More information about the Oberon