<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">><i> -----Original Message-----</i></span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">><i> From: Chris Burrows [mailto:<a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">chris at cfbsoftware.com</a>] on </i></span></font><i style="white-space: normal; background-color: rgba(255, 255, 255, 0); font-family: UICTFontTextStyleBody;"> Sunday, 1 October 2017 9:52 AM </i></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">><i> 
</i>><i> In the original Oberon, NW defined in the low level</i></span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><i>>> compiler module
</i><i>SYSTEM the procedure NEW(v, n).</i></span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><i>>> In Oberon-07 this is not existing anymore. As Andreas Pirklbauer</i></span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><i>>> demonstrated, this functionality can be introduced with</i></span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><i>>> Oberon-07
</i>><i> without changing the language.</i></span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><i>></i></span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><i>> </i>Not exactly. Oberon-07 doesn't allow ARRAY OF <type> in a</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> type or variable declaration (excluding open array parameters</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> which are a different concept). Nor does Oberon-07 allow</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> POINTER TO ARRAY - pointers can only point to RECORDS</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> (which can have ARRAYs as fields).

If these syntax changes</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> were introduced they would need to be considered as language</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> extensions. There would also be the question of whether the</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> feature would be restricted to single-dimensional arrays,</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> what notation would be used if multi-dimensional arrays</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> would be used, how many dimensions would be allowed,</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> what are the rules of assignment compatibility issues etc.</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> I have seen various Oberon-style implementations of this</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">> over the years e.g.</span></font></pre><pre><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><br></span></font></pre><pre><span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);">It would be fairly easy to add any of the features mentioned above (e.g. POINTER TO ARRAY, multi-dimensional arrays) to the solution outlined in </span><span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);"><a href="http://www.github.com/andreaspirklbauer/Oberon-generic-heap-allocation">http://www.github.com/andreaspirklbauer/Oberon-generic-heap-allocation</a> , but that is the one thing I did *not* want to do: extend the language itself. </span></pre><pre><span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);"><br></span></pre><pre><span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);">It can of course be done, but one should note that one can always just create a record that then contains any data structure one needs. The downside is that it introduces one additional field in the code, e.g. you write ptr.a[3] instead of ptr[3], where ptr is a POINTER TO R, and R is a RECORD a: ARRAY OF <type> END, making it a little less natural to read.</span></pre><pre><span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);"><br></span></pre><pre><span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);">Just my two (Swiss) Rappen..</span></pre><pre><span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);"><br></span></pre><pre><span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);">-AP</span></pre></div></body></html>