Right. Both seem equally reasonable alternatives if a condition isn't fulfilled where I'd like to continue pattern matching. Why do you say one of these would be fair to disallow?<br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 11, 2016 at 00:39 Erica Sadun <<a href="mailto:erica@ericasadun.com">erica@ericasadun.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Because one says "consider the next case" and the other says "do not consider the next case"</div></div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Jul 10, 2016, at 11:03 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>> wrote:</div><br><div>I know how it works. Why would you say that it's reasonable to prohibit fallthrough when continue is used? The difference between it and break is that Swift chooses the latter to be implied, and obviously we cannot prohibit break.<br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 10, 2016 at 23:51 Erica Sadun <<a href="mailto:erica@ericasadun.com" target="_blank">erica@ericasadun.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Jul 10, 2016, at 10:34 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>> wrote:</div><br><div><br><br style="font-family:Palatino-Roman;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:Palatino-Roman;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Sun, Jul 10, 2016 at 11:21 PM, Erica Sadun<span> </span><span dir="ltr"><<a href="mailto:erica@ericasadun.com" target="_blank">erica@ericasadun.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span><blockquote type="cite"><div>On Jul 10, 2016, at 10:16 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>> wrote:</div><div><div dir="ltr" style="font-family:Palatino-Roman;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote"><div>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><br></div><div>```</div><div>switch x /* or y, or z */ {</div><div>case A:</div><div> <span> </span>// ...</div><div> <span> </span>continue</div><div>case B:</div><div> <span> </span>// ...</div><div> <span> </span>if C ~= x /* or y, or z, whichever is switched over */ {</div><div> <span> </span>continue</div><div> <span> </span>}</div><div> <span> </span>fallthrough</div></div></div></div></div></blockquote><div><br></div></span><div>I'd say it would be fair to disallow continue and fallthrough to occur in the same clause</div></div></div></blockquote><div><br></div><div>Why should `fallthrough` be prohibited but implicit `break` become mandatory in such a clause? If `continue` were to be implemented in this context, I'd want the full power of the keyword, including being allowed to `continue` conditionally, `continue` with different labels, and round out the case if no conditions are satisfied with either `fallthrough` or `break` (or, for that matter, `return`, etc.).</div></div></div></blockquote><br></div></div><div style="word-wrap:break-word"><div>I do not understand. `break` is already implicit unless no other code is used. </div><div><br></div><div><font face="Menlo">case something:</font></div><div><font face="Menlo"> if condition { continue }</font></div><div><font face="Menlo"> // ends here. the compiler knows not to go forward and it's not an empty clause</font></div><div><font face="Menlo">case somethingElse:</font></div><br><div>`fallthrough` means "ignore the next case statement and execute its clause".</div></div><div style="word-wrap:break-word"><div><br></div><div>-- E</div></div></blockquote></div>
</div></blockquote></div><br></div></blockquote></div>