<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="font-family: monospace; white-space: pre-wrap;" class="">  > </span><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">I believe this problem was addressed in the 23.9.2017</span></font><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">  > update of Project Oberon with a language restriction</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">  > implemented in ORP.Mod. If you try to compile the</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">  > code above you will now get the error message:
  >
  > "Error: must point to named record”</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=""><br class=""></span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">Correct. This is when it happened. It came out </span></font><span style="white-space: pre-wrap; font-family: monospace;" class="">of a d</span><span style="white-space: pre-wrap; font-family: monospace;" class="">iscussion</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">about type descriptors and a suggestion </span><span style="white-space: pre-wrap; font-family: monospace;" class="">I had made back then</span><span style="font-family: monospace; white-space: pre-wrap;" class="">.</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class=""><br class=""></span></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">Prior to </span></font><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">23.9.2017 </span></font><span style="white-space: pre-wrap; font-family: monospace;" class="">it possible to declare pointers to</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">*anonymous* </span><span style="font-family: monospace; white-space: pre-wrap;" class="">records eg: TYPE T = POINTER TO RECORD .. END.</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class=""><br class=""></span></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">The issue with this was that the compiler did not (and still</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">does </span></font><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">not) create type </span></font><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">descriptors </span></font><span style="white-space: pre-wrap; font-family: monospace;" class="">for *anonymous* records.</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">This created a problem if a </span><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">dynamic variable </span></font><span style="white-space: pre-wrap; font-family: monospace;" class="">pointing to</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">an *anonymous* record type is </span><span style="white-space: pre-wrap; font-family: monospace;" class="">allocated via </span><span style="white-space: pre-wrap; font-family: monospace;" class="">the predefined</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">procedure NEW (which accesses </span><span style="white-space: pre-wrap; font-family: monospace;" class="">the type </span><span style="white-space: pre-wrap; font-family: monospace;" class="">descriptor to obtain</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">the size of the record about to </span><span style="font-family: monospace; white-space: pre-wrap;" class="">be allocated in the heap).</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=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">Solution #1 is to also create type descriptors </span></font><span style="white-space: pre-wrap; font-family: monospace;" class="">for *anonymous*</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">records, which could be accomplished by changing </span><span style="font-family: monospace; white-space: pre-wrap;" class="">ORP.Type0 to:</span></div><div class=""><br class=""></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">    IF type.base.form # ORB.Record THEN ORS.Mark("must point to record”)</span></font></div><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">    ELSIF type.base.typobj = NIL THEN ORG.BuildTD(type.base, dc)    (*type descriptor; len used as its address*)<br class="">    END</span></font><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=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">Solution #2 is to </span></font><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">restrict pointers to </span></font><span style="white-space: pre-wrap; font-family: monospace;" class="">*named* records, </span><span style="font-family: monospace; white-space: pre-wrap;" class="">which is</span></div><div class=""><span style="font-family: monospace; white-space: pre-wrap;" class="">accomplished by replacing the above IF statement in ORP.Type0 to:</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class=""><br class=""></span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">  </span><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">IF (type.base.form # ORB.Record) OR (type.base.typobj = NIL) THEN</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">    ORS.Mark("must point to named record”)</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">  END</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=""><br class=""></span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class="">Solution #2 was retained. It leads to more readably code, </span></font><span style="font-family: monospace; white-space: pre-wrap;" class="">even though</span></div><div class=""><span style="font-family: monospace; white-space: pre-wrap;" class="">the necessity to declare a pointer type AND its record </span><span style="white-space: pre-wrap; font-family: monospace;" class="">type my be</span></div><div class=""><span style="white-space: pre-wrap; font-family: monospace;" class="">perceived as somewhat annoying. But one can certainly </span><span style="white-space: pre-wrap; font-family: monospace;" class="">live with it.</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="">Andreas</span></font></div><div class=""><font face="monospace" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div></body></html>