<div dir="ltr">Yes,<div>The old man has been right most of the time, I agree. And I will have a royal battle to reduce the compiler construction back down to Wirthian elegance, that I also realize. But at the same time the code I produce is very elegant and sweet. On the basis of that I would say you are wrong in your statement that IF THEN can be made as efficient as a good case construct. Besides, a Case statement allows ranges like A..Z, a..z and so on, this has never been part of IF THEN, while in a properly constructed bin-tree it resolves itself.</div><div><br></div><div>So since Wirth was first and foremost a teacher all his life, we could say that there are 2 learning opportunities here</div><div>1. to produce fast code.</div><div>2. to construct an elegant way of doing so.</div><div><br></div><div> I think that the master himself also realized the issues you and I are bringing up, and did not see his way out of the predicament yet. And since he is about 80 now and since he still got a few irons in the fire this was left for a bit.<br></div><div><br></div><div>Lastly Dijkstra taught that you should never limit yourself because of inefficient machines. But you should strive to generalize any language design solution to as many cases as possible, even if that slows your program execution down a bit. There were big arguments in the Algol design meetings about that. Some people then felt that you had to live with the equipment given and use it as efficiently as possible. Wirth no doubt knows that whole history even better than I do. In the mean time of course, the machine limitations of those days (it was the time of the vacuum tubes) have been solved a hundred times over, but we still are trying to live with the language limitations of some of the older languages.</div><div>Ergo the numerical case statement is in the O-7 language report, but is has not been implemented yet.</div><div><br></div><div>So I feel fully justified implementing it. The way how to, we can talk about. If the Oberon community is alive and well ten I am sure that the last word has not been spoken yet.</div><div><br></div><div><br></div><div>Enjoy your day</div><div><br></div><div>j.</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 10, 2015 at 3:23 PM, John Stout <span dir="ltr"><<a href="mailto:JSS@kgv.ac.uk" target="_blank">JSS@kgv.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal">I wonder what Professor Wirth’s views might be on this.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">From the book The School of Niklaus Wirth (>> The Art of Simplicity<<) ISBN 1-55860-723-4, the chapter by Michael Franz called Oberon – The Overlooked Jewel:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">“I still vividly remember the day that With decided to replace the elegant data structure used in the compiler’s symbol table handler by a mundane linear list. In the original compiler, the objects in the symbol table had been sorted in
a tree data structure (in identifier lexical order) for fast access, with a separate linear list representing their declaration order. One day Wirth decided that there really weren’t enough objects in a typical scope to make the sorted tree cost-effective.
All of us Ph.D. students were horrified: it had taken <i>time</i> to implement the sorted tree, the solution was
<i>elegant</i>, and it worked <i>well</i> – so why would one want to throw it away and replace it with something
<i>simpler</i>, and even worse, something as prosaic as a linear list? But of course, Wirth was right, and the simplified compiler was both smaller and faster than its predecessor.”<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The implementation using IF … THEN chains is simple. If the most common cases are positioned first in the chain then the execution time for these cases is minimised. The compiler will be simpler, the implementation of the ELSE (or an error)
is simple to implement and the compiler will be simple and fast.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Looking through the body of Oberon code that we have what is the distribution of the number of cases? I realise we are talking about a new feature, but I still favour the simple solution, in keeping with the spirit of Oberon.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">John Stout<u></u><u></u></p>
</div>
<br>
<table border="0" cellpadding="0" width="600" style="width:450.0pt">
<tbody>
<tr>
<td width="120" style="width:90.0pt;padding:.75pt .75pt .75pt .75pt"><img width="120" height="88" src="http://apply.kgv.ac.uk/images/logo.gif" alt="King George V Logo">
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:gray"><b>John Stout</b><br>
Management Information Systems Coordinator <br>
Tel: 01704 530601<br>
E-Mail: <a href="mailto:JSS@kgv.ac.uk" target="_blank">JSS@kgv.ac.uk</a><br>
Web: <a href="http://www.kgv.ac.uk" target="_blank">www.kgv.ac.uk</a></span> </p>
</td>
</tr>
</tbody>
</table>
<br>
<table border="0" cellpadding="0" width="600" style="width:450.0pt">
<tbody>
<tr>
<td width="600;padding:.75pt">
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Tahoma",sans-serif;color:gray">Information contained in this e-mail is intended for the use of the addressee only and is confidential. Any dissemination, distribution,
copying or use of this communication without prior permission of the addresseeis strictly prohibited.<br>
<br>
Every effort has been made to ensure that any attachment to this mail does not contain virus. King George V College has taken every reasonable precaution to minimise this risk, neither it nor the sender can accept liability for any damage which you sustain
as a result of software viruses. You should carry outyour own virus checks before opening any attachments.<br>
<br>
</span></p>
<img width="236" height="35" src="http://apply.kgv.ac.uk/images/thinkprint.jpg" alt="Think Before You Print">
</td>
</tr>
</tbody>
</table>
</div>
<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" rel="noreferrer" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br>
<br></blockquote></div><br></div>