After working with Prof Wirth's latest Oberon for FPGA compiler, and receiving replies to a couple of questions I realise that my last reply, and probably some of my earlier posts in this discussion, were incorrect.
The following is actually legal Oberon code because PROCEDURE Q is a local variable in the outer scope:
Code: Select all
PROCEDURE Q;
VAR Q: INTEGER;
BEGIN
...
Q := 0;
The consequence of this is that you would not be able to call Q recursively
in this example.
Similarly (though unlikely to be seen in the real world) the following is also legal:
Code: Select all
PROCEDURE P2;
PROCEDURE P2;
BEGIN
...
END P2;
BEGIN
P2
END P2;
Again the call to P2 is not recursive as it refers to the local P2.
Therefore, for now, I am now planning to keep the behaviour of nested procedures and local objects the same as it was in Astrobe v4.5.