<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Chris<div><br></div><div>Why is it invalid?<div><br></div><div>By forbidding access to intermediate variables, constants and types, P becomes „self-contained“ (aka could be freely moved around without any harm).</div><div><br></div><div>One may ask „why is P declared local to P1 instead of global“. But this is another discussion.</div><div><br id="lineBreakAtBeginningOfSignature"><div dir="ltr">br<br><div>Jörg</div></div><div dir="ltr"><br><blockquote type="cite">Am 20.12.2023 um 07:11 schrieb Chris Burrows <cfbsoftware@gmail.com>:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Wed, Dec 20, 2023 at 5:50 AM August Karlstrom <<a href="mailto:fusionfile@gmail.com">fusionfile@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In two recent threads we have discussed scopes and local procedures in <br>
Oberon-07. One thing that I have been thinking about is that since the <br>
change was made to prevent access to intermediate scopes the restriction <br>
that a local procedure cannot be assigned to a procedure variable or <br>
passed as a procedure parameter no longer makes any sense. The sentence<br>
<br>
"P must not be declared local to another procedure, and neither can it <br>
be a standard procedure."<br>
<br>
in section 6.5 should be replaced with<br>
<br>
"P cannot be a standard procedure."<br><br></blockquote><div><br></div><div>I disagree. Consider this example:</div><div><br></div><font face="monospace" size="4">MODULE ProcVars1;<br><br>TYPE <br>  ProcType = PROCEDURE();<br><br>VAR<br>  p2: PROCEDURE;<br><br>PROCEDURE GlobalP;<br>BEGIN<br>END GlobalP;<br>  <br>PROCEDURE P1;<br><br>  PROCEDURE P;<br>  BEGIN<br>  END P;<br><br>BEGIN<br>  P(); (* Valid *)<br>  p2 := P; (* Not valid because "P is declared local to another procedure" i.e. P1 *) <br>  p2 := GlobalP; (* Valid *)<br>END P1;<br><br>END ProcVars1.</font><br><div> </div><div>Regards,</div><div>Chris Burrows</div><div>CFB Software</div><div><a href="https://www.astrobe.com">https://www.astrobe.com</a></div><div><br></div></div></div>
<span>--</span><br><span>Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems</span><br><span>https://lists.inf.ethz.ch/mailman/listinfo/oberon</span><br></div></blockquote></div></div></body></html>