The following code:
Code: Select all
PROCEDURE P;
PROCEDURE Q; (*local*)
...
END Q;
PROCEDURE R; (*local*)
BEGIN
...
Q
...
END R;
END P;
Regards
Code: Select all
PROCEDURE P;
PROCEDURE Q; (*local*)
...
END Q;
PROCEDURE R; (*local*)
BEGIN
...
Q
...
END R;
END P;
That statement predates the latest version of the Oberon Language Report but if it is still true then it confirms to me that your initial assertion is correct. Any Oberon programmer should keep that rule in mind if they want to ensure that their code is as portable as possible.4. Objects declared in a procedure P are not accessible within a procedure Q that is itself local to P. That is, objects must be either strictly local or global in order to be accessible.
agrees with the quote you gave from PO2013, if the phrase "locally declared objects" means "objects declared local to the procedure". I think the preceding para:In addition to its formal parameters and locally declared objects, the objects declared globally are
also visible in the procedure
supports that meaning. (The quoted line from PO2013 is more direct, though!)All constants, variables, types, and procedures declared within a procedure body are local to the
procedure...