[Oberon] Intermediate scopes in Oberon-07
andreas_pirklbauer at yahoo.com
Sat Feb 10 13:16:03 CET 2018
> That may be so but may also be irrelevant. I can't think of any genuine use
> for an intermediate TYPE if intermediate variables of that type are inaccessible.
> Can you refer me to an existing real-world practical Oberon example where an
> intermediate type is accessed in a nested procedure?
I can’t think of any! In a previous post I have provided an implementation that
PO2013 makes the compiler consistent in the sense that ALL intermediate objects
(constants, types, procedures) are now treated identically with respect
to *access rights*, i.e. they cannot be accessed in a nested procedures.
A separate question is of course whether one should allow the ability to *declare*
local types or constants at all - it makes of course sense to keep that possibility.
But if local procedures were *eliminated* from the language one day, then the whole
access discussion goes away completely, since in that case intermediate objects (of
any kind!) simply can no longer exist. There can only be (a) global objects or (b)
objects that are local to (globally declared) procedures.
As I said, one can endlessly debate all this…
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Oberon