<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Jul 10, 2016, at 10:16 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><div class=""><div dir="ltr" style="font-family: Palatino-Roman; font-size: 14px; 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-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">Given patterns A, B, C, and D, suppose a value x matches A, C, and D, whereas another value y matches B and D, and a third value matches B and C. When evaluating x, y, or z, which statements are executed in the following switch statement? How many of these reach the default case? What happens if I append `fallthrough` at the end of case D? What happens if I move case B after case D? (Yes, I know it is possible to figure it out [my understanding of the answer to the first question is appended below], but I hope you'll agree with me that this is much more difficult to decipher than any switch statement that's currently possible.)</div><div class=""><br class=""></div><div class="">```</div><div class="">switch x /* or y, or z */ {</div><div class="">case A:</div><div class=""> // ...</div><div class=""> continue</div><div class="">case B:</div><div class=""> // ...</div><div class=""> if C ~= x /* or y, or z, whichever is switched over */ {</div><div class=""> continue</div><div class=""> }</div><div class=""> fallthrough</div></div></div></div></div></blockquote><div><br class=""></div><div>I'd say it would be fair to disallow continue and fallthrough to occur in the same clause</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Palatino-Roman; font-size: 14px; 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-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">case C:</div><div class=""> // ...</div><div class=""> if B ~= x /* or y, or z, whichever is switched over */ {</div><div class=""> continue</div><div class=""> }</div><div class="">case D:</div><div class=""> // ...</div><div class="">default:</div><div class=""> // ...</div><div class="">}</div><div class="">```</div></div></div></div></div></blockquote></div><br class=""></body></html>