[Oberon] Oberon-2 type bound procedure scope

August Karlstrom fusionfile at gmail.com
Sat Dec 9 11:02:49 CET 2023


On 2023-12-07 02:49, Joerg wrote:
> In the procedure you have access all local variables, all parameters,
> all data of the tree scope and all global variables.

You also have access to identifiers in intermediate scopes. In 
Oberon-07, on the other hand, you only have access to the local and the 
global scope. However, there is an additional rule which says that

"The use of the procedure identifier in a call within its declaration 
implies recursive activation of the procedure." 
(https://miasap.se/obnc/oberon-report.html#sec10)

To me it's not clear if the implicit continuation of this sentence is

A) ...even if the procedure identifier is not within scope or
B) ...provided that the procedure identifier is within scope.

Examples:

	PROCEDURE P;

		PROCEDURE Q;
		BEGIN
			Q (*Oberon-2:  Q is called
			    Oberon-07: Q is called (A) or the call is invalid (B)*)
		END Q;

	BEGIN
		Q
	END P


	PROCEDURE R;

		PROCEDURE R;
		BEGIN
			R (*Oberon-2:  R in the intermediate scope is called
			    Oberon-07: R in the intermediate scope is called (A) or R in the 
global scope is called (B)*)
		END R;

	BEGIN
		R
	END R


/August


More information about the Oberon mailing list