<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">I only declare TYPEs if I use them several times (and as base RECORD of a type inheritance hierarchy)<div>To be able to use them several times, I normally declare them on module level.</div><div>With the one exception I mentioned in an earlier mail: local redefinition of parameter TYPEs only used in that procedure.</div><div><br></div><div>Jörg<div><br>Am 11.02.2018 um 18:10 schrieb Andreas Pirklbauer <<a href="mailto:andreas_pirklbauer@yahoo.com">andreas_pirklbauer@yahoo.com</a>>:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><span class="" style="font-family: monospace; white-space: pre-wrap;">  > </span><span style="white-space: pre-wrap; font-family: monospace;" class="">></span><span style="white-space: pre-wrap; font-family: monospace;" class=""> In the entire PO2013 system with850 procedures (of which</span><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">  > > only 17 are </span><span style="white-space: pre-wrap; font-family: monospace;" class="">local ones), </span><span style="white-space: pre-wrap; font-family: monospace;" class="">there is only ONE local TYPE</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">  > > declaration </span><span style="font-family: monospace; white-space: pre-wrap;" class="">and only 8 local CONST </span><span style="white-space: pre-wrap; font-family: monospace;" class="">declarations.</span></div><div class=""><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">
  > Since this example has been cited several times now: I think</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">  > that it tells more about the programming style preferred by</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">  > Niklaus Wirth than about the actual value of local declarations.</span></font><div class=""><font face="monospace" class=""><span class="" style="white-space: pre-wrap;">  > Being able to declare types locally is not so much about</span></font></div><div class=""><font face="monospace" class=""><span class="" style="white-space: pre-wrap;">  > information  </span></font><span style="white-space: pre-wrap; font-family: monospace;" class="">hiding as it is making the code easier to understand.</span><div class=""><div class=""><span class="" style="font-family: monospace; white-space: pre-wrap;"><br class=""></span></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">That may be true. OTOH, the authors of System 3 (ETH Oberon),</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">Oberon V4 (Linz Oberon) and A2 (formerly) - all considerably</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">larger systems and Original Oberon - also don’t seem to use</span></font></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">local procedures or locally declared types very much. And </span><span style="font-family: monospace; white-space: pre-wrap;" class="">I</span></div><div class=""><span style="font-family: monospace; white-space: pre-wrap;" class="">don’t think the authors of these systems blindly follow someone</span></div><div class=""><span style="font-family: monospace; white-space: pre-wrap;" class="">else’s programming style.</span></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=""><br class=""></span></font></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class=""><br class=""></span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></div></div></div></blockquote><blockquote type="cite"><div><span>--</span><br><span><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems</span><br><span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a></span><br></div></blockquote></div></body></html>