[Oberon] Intermediate scopes in Oberon-07

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Sun Feb 11 11:20:59 CET 2018

  > Being able to declare types locally is not so much about information 
  > hiding as it is making the code easier to understand.

There are 2 separate questions: Should a language allow to..

(1) *declare* local types and constants, in addition to local variables
(2) *access* locally declared types and constants within nested scopes

Few people would object to allowing (1) although one might argue even about that.
As Chris has pointed out, this  feature doesn’t seemed to be used much in practice.
In the entire PO2013 system with 850 procedures (of which only 17 are local ones),
there is only ONE local TYPE declaration and only 8 local CONST declarations.

With respect to (2), Chris’ main point was that - now that local variables can no
longer be accessed in nested scopes anyway (since the Oberon-07 revision) - what
is an example of a genuine use for an intermediate TYPE if intermediate *variables*
of that type are inaccessible in nested scopes.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20180211/bdebb704/attachment.html>

More information about the Oberon mailing list