<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="">
<div>
<blockquote type="cite" class="">
<div class="">On Jun 2, 2022, at 2:22 PM, Dan Smith <<a href="mailto:daniel.smith@oracle.com" class="">daniel.smith@oracle.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; 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; text-decoration: none;" class="">
Ideally, the fallthrough rule should be about _bindings_, not _patterns_. If P an Q are patterns with no binding variables, then it should be OK to say:<br class="">
<br class="">
case P:<br class="">
case Q:<br class="">
<br class="">
The rule about fallthrough is to prevent falling into code where the bindings are not DA.<br class="">
</blockquote>
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Yes,
understood.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">The
current explanation doesn't actually treat this as fallthrough, though: it treats it as if you said 'case 23, Pattern:', which is disallowed by a different rule.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
</div>
</div>
</blockquote>
</div>
<br class="">
<div class="">Oh, I guess I missed your point here, thinking that P and Q were constants.</div>
<div class=""><br class="">
</div>
<div class="">Your comment implies that the two rules that restrict usage of patterns—can't fall through past one, and can't combine one (via ',') with most other labels—could be relaxed slightly in the case of patterns that have no bindings. I suppose that's
formally true, though I'm not sure it's practically all that useful. (The only non-binding pattern we have right now is a zero-component record, right? And any non-binding patterns in the future could be equivalently expressed with 'when' clauses.)</div>
<div class=""><br class="">
</div>
<div class="">This is an orthogonal point to my suggestion that sets of switch block labels not be merged; it is relevant, however, to my suggestion that Patterns be syntactically impossible to combine (via ',') with most other labels.</div>
</body>
</html>