<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div>On Thu, Feb 15, 2018, at 4:12 PM, Jörg wrote:<br></div>
<blockquote type="cite"><div><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style=""> </span></span></span><br></p><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style="">If you write something like this</span></span></span><br></p><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style=""> CASE idx OF</span></span></span><br></p><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style=""> 0: idx := idx + 42</span></span></span><br></p><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style=""> | 2000: idx := idx * 2</span></span></span><br></p><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style=""> ELSE</span></span></span><br></p><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style=""> END</span></span></span><br></p><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style="">and the compiler would implement it with a table, you have 1999 useless entries.</span></span></span><br></p></div>
</blockquote><div><br></div>
<div style="background-color: transparent; color: rgb(31, 31, 31); /*font-family: "*/Source Sans Pro",sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: 0.1px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">In the past Pascal and Modula-2 compilers always limited case labels to 127 or 255, these two limits<br></div>
<div style="background-color: transparent; color: rgb(31, 31, 31); /*font-family: "*/Source Sans Pro",sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: 0.1px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">are also reasonable today and the entries' loss is very negligible.<br></div>
<div><br></div>
<div><br></div>
<blockquote type="cite"><div><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style="">NW seems to have changed his mind on CASE. The compiler itself rarely uses CASE these days. eg ORS.Get() formerly THE case for CASE uses cascaded IFs</span></span></span><br></p><p style="margin: 0cm 0cm 0pt;"><span class="font" style='font-family:"Calibri",sans-serif'><span class="size" style="font-size:11pt"><span lang="EN-US" style=""> </span></span></span><br></p></div>
</blockquote><div><br></div>
<div>In "An Oberon Compiler for the ARM Processor", he wrote: The scanner is one of the few routines where a case statement is highly valuable.<br></div>
<div><br></div>
<div>I agree with that not only for the constant time of the jump table but for the aesthetic, it is a nightmare how it was coded in current PO2013 :-)</div>
<div><br></div>
<div>--<br></div>
<div>Diego Sardina<br></div>
</body>
</html>