<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font size="4" face="monospace">As you observe, this is an entirely
reasonable fit for switch. However, if we were to just do labels
like:<br>
<br>
case 1..10:<br>
<br>
this would fall into the category of "ad-hoc syntax-oriented
feature", and our budget for such things is limited (and arguably
overspent.) To make such a feature worthwhile, we'd want to
address ranges more holistically, such as support in loops,
arrays, ranges of other ordered types (such as long or enums),
etc. Which is a totally reasonable feature to consider, but is
also more significant in scope. <br>
<br>
<br>
</font><br>
<div class="moz-cite-prefix">On 3/13/2024 8:16 AM, Red IO wrote:<br>
</div>
<blockquote type="cite" cite="mid:CABKyW1vZq7bM1uj2B5K_UN7f7oYv3GuhfAB2B=apcwr5tTHHNg@mail.gmail.com">
<div dir="auto">The switch statement saw a huge transformation
over the past few releases. So I was quite surprised to realize
that the current switch construct can't check the range of an
value.
<div dir="auto">Example case x is between y and z.</div>
<div dir="auto">I'm most likely not the first one to notice
that. Is there any discussion about adding some sort of range
pattern? Would fit in the notion of the switch checking
patterns quite well. </div>
<div dir="auto"><br>
</div>
<div dir="auto">Great regards </div>
<div dir="auto">RedIODev </div>
</div>
</blockquote>
<br>
</body>
</html>