[Oberon] Oberon-2 type bound procedure scope

August Karlstrom fusionfile at gmail.com
Sun Dec 10 09:50:40 CET 2023


On 2023-12-10 04:59, Jörg wrote:
> When the compiler sees „Q“ in Q, it searches the local Q-scope for
> „Q“ —> not found It goes on and searches „Q“ in the next P-scope —>
> found. Generates a call to Q that happens to be recursive.

In Oberon-2 the compiler goes on to search the intermediate scope 
defined by P as you say but in Oberon-07 it skips the intermediate 
scope(s) and goes on to search the global scope:

"In addition to its formal parameters and locally declared objects, the 
objects declared globally are also visible in the procedure."

However, in Oberon-07 the additional rule

"The use of the procedure identifier in a call within its declaration
implies recursive activation of the procedure."

*may* imply that the procedure identifier of a local procedure is also 
visible inside its declaration depending on the two interpretations of 
the language report (A and B in my previous post).


August


More information about the Oberon mailing list