<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=""><span style="white-space: pre-wrap; font-family: monospace;" class=""> > Hi all</span><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> >
> In low layer modules, I like to declare local TYPEs in a</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> > procedure to redefine the TYPE of a parameter. Just as an</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> > example parameter is INTEGER, I would like to work with</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> > C4 = ARRAY 4 OF CHAR. Obviously, I could work on the</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> > parameter with pure SYSTEM.GETs but for the sake of the</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> > example let’s stick to C4 for a minute.
>
> Now, as Oberon has no macros, I declare in my PROCEDURE</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> > with the local C4 another nested procedure as kind of</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> > writing shortcut in my procedure’s code.</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> >
> Et voila, I‘m in the situation where the nested procedure</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> > should have access to the intermediately declared C4.
>
> Would you accept this as a valid example for intermediate TYPEs?
>
> Jörg</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">I assume you mean something like this:</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> MODULE M;</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> PROCEDURE P(x: INTEGER);</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> TYPE C4 = ARRAY 4 OF CHAR;</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> </span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> PROCEDURE Q(y: INTEGER);</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> VAR c4: C4; (*intermediate type C4 used here*)</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> BEGIN</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> END Q;</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> END P;</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""> END M.</span></font></div><div class=""><br class=""></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">The current official Oberon compiler, as published in <a href="http://projectoberon.com" class="">projectoberon.com</a>,</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">would accept it, </span></font><span style="white-space: pre-wrap; font-family: monospace;" class="">my slightly modified compiler from the last post wouldn’t</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">and would require C4 to be declared globally.</span></div><div class=""><br class=""></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">Andreas</span></div></body></html>