[Oberon] Intermediate scopes in Oberon-07
bob at web-options.com
Sat Feb 10 10:14:46 CET 2018
On 10 Feb 2018, at 00:26, Chris Burrows <chris at cfbsoftware.com> wrote:
> 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"?
High coherence and loose coupling being desirable qualities, in general, this might be an indication that you are over-using global declarations and therefore going against these two principle.
More information about the Oberon