<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">To make Jörg’s point even clearer, let me say that one of the functions of a type system is to safeguard from programming errors. Reason I declare something of type A and something of type B is to make clear that a and b are not compatible and thus whenever I use the two in the same computation, the compiler will tell me, that I am doing something stupid. If then A and B are structurally equivalent and therefor the compiler accepts I mix a and b in a computation and the compiler does not give an error then I loose the type safety.</div><div class=""><br class=""></div><div class="">Said that I understand the discussion that is happening now, because there are two sides of the medal. The one side is the above mentioned. The other one is, that there are some generic concepts that apply to all kind of structural equivalent things. Thus sometimes you prefer one behaviour sometimes the other.</div><div class=""><br class=""></div><div class="">Some programming languages try to offer both by having structural equivalence with an added way to declare a type as something distinct which is based on that structure, some mechanisms that would even allow you to declare Apples=new Integer, Oranges=new Integer, causing then apples+oranges be flagged as an error yet providing all integer operations so you can do appleBag1+appleBag2, The downside is of course, that such a language is more complex than Oberon.</div><div class=""><br class=""></div><div class="">I don’t really know what the “best” solution is. I tend to prefer type safety over convenience, because it helps me in writing programs with less bugs.</div><div class=""><br class=""></div><div class="">claudio</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 6. Oct. 2017, at 13:20, Jörg <<a href="mailto:joerg.straube@iaeth.ch" class="">joerg.straube@iaeth.ch</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">VAR<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""> nbrOfBirthsPerMonth: ARRAY 12 OF INTEGER;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""> nbrOfAccidentsPerMonth: ARRAY 12 OF INTEGER;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">nbrOfBirthPerMonth := nbrOfAccidentsPerMonth (* these match structurally but makes not much sense, should be forbidden *)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">If you want to write a generic module handling monthly statistics, you have open ARRAYs and the exceptions for assignments of actual to formal.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">PROCEDURE StoreYear (a: ARRAY OF INTEGER); (* … *)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">StoreYear (nbrOfBirthsPerMonth); (* structural match *)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">StoreYear (nbrOfAccidentsPerMonth);<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">If you have a procedure like StoreBirths (); you should not use open ARRAYs, as then StoreBirths (nbrOfAccidentsPerMonth) would be possible…<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">br<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Jörg<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 12pt;" class="">Von:<span class="Apple-converted-space"> </span></span></b><span style="font-size: 12pt;" class="">Oberon <<a href="mailto:oberon-bounces@lists.inf.ethz.ch" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">oberon-bounces@lists.inf.ethz.ch</a>> im Auftrag von Andreas Pirklbauer <<a href="mailto:andreas_pirklbauer@yahoo.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">andreas_pirklbauer@yahoo.com</a>><br class=""><b class="">Antworten an:<span class="Apple-converted-space"> </span></b>ETH Oberon and related systems <<a href="mailto:oberon@lists.inf.ethz.ch" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">oberon@lists.inf.ethz.ch</a>><br class=""><b class="">Datum:<span class="Apple-converted-space"> </span></b>Freitag, 6. Oktober 2017 um 13:17<br class=""><b class="">An:<span class="Apple-converted-space"> </span></b>ETH Oberon and related systems <<a href="mailto:oberon@lists.inf.ethz.ch" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">oberon@lists.inf.ethz.ch</a>><br class=""><b class="">Betreff:<span class="Apple-converted-space"> </span></b>[Oberon] Clarifying type compatibility in Oberon-07<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">></span><o:p class=""> </o:p></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">> </span><span style="font-family: monospace, serif;" class="">Personally, I’m not indifferent<span class="Apple-converted-space"> </span></span><span style="font-family: "MS Mincho", serif;" class="">☺</span><span style="font-family: monospace, serif;" class=""><span class="Apple-converted-space"> </span>> > I know that it can be done, but the question is WHY.</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">> Only because something can be done is a poor reason to do it.</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">> > > If you put a := b in your code, you do that as you know or</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">> assume a certain relationship between those two variables</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">> (they e.g. represent instances of the same or comparable</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">> thing). If this hold true, I don’t understand why you</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">> have to write two totally independent type declarations</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">> that (by accident) match structurally. > > br > > Jörg</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">></span><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class=""><br class=""><br class=""></span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">Jörg, you have a valid point - no question! I value such input</span><span style="font-family: Courier, serif;" class="">. As</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">I said myself earlier “I just don’t have a good enough reason yet”.</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class=""><br class=""><br class=""></span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">But I do want to continue exploring the question a little bit, now</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">that the topic has come up for the N-th time in M decades. P</span><span style="font-family: Courier, serif;" class="">erhaps</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">this time around, someone comes up with a new insight or a “good</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">enough” reason for changing the language.</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">If I understand you correctly, your position can also be viewed</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">as: “If as a language designer one does have a chance or option</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">to promote ‘good’ programming style (whatever that means), one</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">should</span><span style="font-family: Courier, serif;" class=""><span class="Apple-converted-space"> </span>by all means use it”.. In the particular case of array</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">type equivalence discussed in this forum, it effectively amounts</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">to forcing programmers to write one type declaration instead of two;</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">which I too view as good programming practice, which in addition</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">increases code readability in my opinion.</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class=""><br class=""><br class=""></span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">Perhaps yet another way to look at your position is this: Once I do</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">allow structural equivalence for<span class="Apple-converted-space"> </span></span><span style="font-family: Courier, serif;" class="">arrays, I can never go back in the</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">future without breaking someone’s legacy code. So, in the<span class="Apple-converted-space"> </span></span><span style="font-family: monospace, serif;" class="">absence</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">of a really compelling reason to actually *allow*<span class="Apple-converted-space"> </span></span><span style="font-family: Courier, serif;" class="">structural</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">equivalence for arrays, one should “play safe” and disallow it.</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">Perhaps<span class="Apple-converted-space"> </span></span><span style="font-family: Courier, serif;" class="">that is what the Pascal/Modula/Oberon compiler writers</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: Courier, serif;" class="">felt all those years..</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">PS: I’m now 60/40 - does that make you feel better? ;-)</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class="">-AP</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class=""><br class=""><br class=""></span><o:p class=""></o:p></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: monospace, serif;" class=""><br class=""><br class=""></span><o:p class=""></o:p></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">--<span class="Apple-converted-space"> </span><a href="mailto:Oberon@lists.inf.ethz.ch" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">Oberon@lists.inf.ethz.ch</a><span class="Apple-converted-space"> </span>mailing list for ETH Oberon and related systems<span class="Apple-converted-space"> </span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><o:p class=""></o:p></div></div><span style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">--</span><br style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><a href="mailto:Oberon@lists.inf.ethz.ch" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class="">Oberon@lists.inf.ethz.ch</a><span style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span>mailing list for ETH Oberon and related systems</span><br style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class="">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""></div></blockquote></div><br class=""></div></body></html>