<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">> On 2017-09-28 21:15, August Karlstrom wrote </pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">> > On 2017-09-28 18:57, Andreas Pirklbauer wrote:
> ></span><i style="white-space: pre-wrap;" class=""> Addendum: Another way to read the sentence “P must not be declared local to ANOTHER
</i><span style="white-space: pre-wrap;" class="">> ></span><i class=""><span style="white-space: pre-wrap;" class=""> procedure” is that in fact “P may be declared local to the SAME procedure”.</span></i><i style="white-space: pre-wrap;" class="">
</i><span style="white-space: pre-wrap;" class="">>
> Your interpretation seemed far fetched at first, but you are most likely right. I get it now.
>
> -- August</span></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">In fact, with the latest revision of Oberon-07 one could rewrite the above language rule as “If a procedure P is assigned to a procedure variable v, both v and P must be visible in the scope where the assignment is made and when it is made”.</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">Thus, Oberon-07 now no longer *require*s the enclosing scope of a local procedure P to be active when P is executed. P only needs to be “reachable somehow”, and this could be via a global variable, as shown below. However I would not recommend adopting such a programming pattern (the example is just meant to show what is now “legally possible”). This may be why this new “feature" is advertised anywhere. It can be seen a byproduct of the decision to restrict access to variables on the global or the strictly local level. This eliminated the need for a static link in implementations. And this in turn means that the enclosing scope doesn’t have to be around anymore when a procedure P is executed.</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">-Andreas</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">MODULE M;<br class=""> TYPE Proc = PROCEDURE;<br class=""> VAR GlobalVar: Proc;<br class=""><br class=""> PROCEDURE GlobalProc1;<br class=""> VAR LocalVar1: Proc;<br class=""> PROCEDURE LocalProc1; BEGIN END LocalProc1;<br class=""> BEGIN (*GlobalProc1*)<br class=""> END GlobalProc1;<br class=""><br class=""> PROCEDURE GlobalProc2;<br class=""> VAR LocalVar2: Proc;<br class=""> PROCEDURE LocalProc2; BEGIN END LocalProc2;<br class=""> BEGIN (*GlobalProc2*)<br class=""> GlobalVar := GlobalProc1; (*allowed*)<br class=""> GlobalVar := GlobalProc2; (*allowed*)<br class=""> GlobalVar := LocalProc2; (*allowed (LocalProc2 visible in current scope)*)<br class=""><br class=""> LocalVar2 := GlobalProc1; (*allowed*)<br class=""> LocalVar2 := GlobalProc2; (*allowed*)<br class=""> LocalVar2 := LocalProc2; (*allowed (LocalProc2 visible in current scope)*)<br class=""> (* <br class=""> GlobalVar := LocalProc1; (*not allowed (LocalProc1 undefined)*) <br class=""> LocalVar1 := GlobalProc1; (*not allowed (LocalVar1 undefined)*) <br class=""> LocalVar1 := GlobalProc2; (*not allowed (LocalVar1 undefined)*) <br class=""> LocalVar1 := LocalProc1; (*not allowed (LocalVar1 and LocalProc1 undefined)*) <br class=""> LocalVar1 := LocalProc2; (*not allowed (LocalVar1 undefined)*) <br class=""> *)<br class=""> END GlobalProc2;<br class=""><br class="">BEGIN (*M*)<br class=""> GlobalVar := GlobalProc1; (*allowed*)<br class=""> GlobalVar := GlobalProc2; (*allowed*)<br class=""> GlobalVar; (*allowed*)<br class=""> GlobalProc2; (*allowed (assigns LocalProc2 to GlobalVar)*)<br class=""> GlobalVar; (*allowed (effectively executes LocalProc2) !!!*)<br class=""> (* <br class=""> GlobalVar := LocalProc1; (*not allowed (LocalProc1 undefined)*) <br class=""> GlobalVar := LocalProc2; (*not allowed (LocalProc2 undefined)*) <br class=""> <br class=""> LocalVar1 := GlobalProc1; (*not allowed (LocalVar1 undefined)*) <br class=""> LocalVar1 := GlobalProc2; (*not allowed (LocalVar1 undefined*) <br class=""> LocalVar1 := LocalProc1; (*not allowed (LocalVar1 and LocalProc1 undefined)*) <br class=""> LocalVar1 := LocalProc2; (*not allowed (LocalVar1 and LocalProc2 undefined)*) <br class=""> <br class=""> LocalVar2 := GlobalProc1; (*not allowed (LocalVar2 undefined)*) <br class=""> LocalVar2 := GlobalProc2; (*not allowed (LocalVar2 undefined*) <br class=""> LocalVar2 := LocalProc1; (*not allowed (LocalVar2 and LocalProc1 undefined)*) <br class=""> LocalVar2 := LocalProc2; (*not allowed (LocalVar2 and LocalProc2 undefined)*) <br class=""> *)<br class="">END M.<br class=""><br class=""></span></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""></pre><pre style="background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre></body></html>