<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Jörg,<div><br></div><div>You wrote:</div><div><br></div><div><blockquote type="cite"><div>(...)<br>You will see that the two strings are NUL terminated and padded to 32 bit boundary.<br></div></blockquote><br></div><div>That's OK. I understand.</div><div><br></div><div>But my point was that under the current Revised Oberon definition software writers should not <i>expect</i> strings to be NUL terminated.</div><div>And possibly that would come as a surprise to some, because before 2011 it used to be different. </div><div><br></div><div>And there's still some work to be done before all existing Oberon code handles strings accordingly.</div><div><br></div><div>__</div><div>Hans</div><div><br><div><div><br></div><div>_________</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hans<br><br>I was talking on the compiler implementation and not on the type compatibility rules.<br><br>You can test it yourself: Compile this and execute the command in the last line<br>- - - <br>MODULE Test;<br>CONST s1 = „abc“; s2 = „abcd“;<br>END Test.<br>ORP.Compile Test.Mod ~<br>ORTool.DecObj Test.rsc<br>- - - -<br><br>You will see that the two strings are NUL terminated and padded to 32 bit boundary.<br><br>br<br>Jörg<br><br><blockquote type="cite">Am 15.04.2016 um 00:29 schrieb Hans Klaver <<a href="mailto:hklaver@dds.nl">hklaver@dds.nl</a>>:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Jörg wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Indeed, implementation of Oberon strings is different than Strings in Pascal. They are NUL terminated and padded to 32 bit boundary.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Starting with the 22.9.2011 version of the Oberon-07 Language Report strings in Oberon no longer are required to end with a null character. This is because from then on the notion of a character constant ceased to exist: things like "a" and 7AX now are considered single character strings, and a single character string can be assigned to variables of type CHAR. The only instance where the terminating 0X character is mandatory is when a string is assigned to an ARRAY n OF CHAR that is longer than the string.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">See paragraphs 3. and 9.1.2 of the current report <a href="https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.Report.pdf">https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.Report.pdf</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">With this language change Wirth in one fell swoop resolved all problems and inconsistencies that had existed since Modula-2 in the definition and interaction of character constants, variables of type CHAR, strings and arrays of CHAR.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The remaining problem is that several current modules of Project Oberon contain procedures that are not yet made up to date with this language change. E.g. the procedures Files.WriteString and Texts.WriteString end in a TRAP when called with a string or character array that is not terminated with a 0X character.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite">Hans Klaver<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Op 11 apr. 2016, om 21:37 heeft Jörg Straube het volgende geschreven:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Indeed, implementation of Oberon strings is different than Strings in Pascal. They are NUL terminated and padded to 32 bit boundary.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Jörg<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Am 11.04.2016 um 20:29 schrieb Tomas Kral <<a href="mailto:thomas.kral@email.cz">thomas.kral@email.cz</a>>:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Hi,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I am still reading PO.Applications, chapters on Compiler.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Looking at strings sample code pattern:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">BEGIN<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">s0 := "ABCDEF"; <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">...<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">ADD R0 SB 0 @s0 <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">ADD R1 SB 64 @"ABCDEF" <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">LDR R2 R1 0 <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">ADD R1 R1 4 <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">STR R2 R0 0 <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">ADD R0 R0 4 <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">ASR R2 R2 24 test for 0X <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">BNE -6 <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">...<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">My understanding is that strings are copied/assigned by 4 bytes (long<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">words) at a time in a loop that ends when 0X (NULL) is found. This may<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">also impose Strings of even lengths may have to be padded with 0X..0X on<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">long word boundary.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Correct?<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">This came as a surprise to me as I remember from University days about<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Pascal/Modula strings, having a length byte in front.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Many thanks.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">-- <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Tomas Kral <<a href="mailto:thomas.kral@email.cz">thomas.kral@email.cz</a>><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">--<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">--<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite"><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br></blockquote><blockquote type="cite"><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br></blockquote><br>--<br><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br></div></blockquote></div><br></div></body></html>