<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 class="">Because one says "consider the next case" and the other says "do not consider the next case"</div><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 10, 2016, at 11:03 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">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 class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, Jul 10, 2016 at 23:51 Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>&gt; wrote:<br class=""></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" class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 10, 2016, at 10:34 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class=""><div class=""><br class=""><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" class=""><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 class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:erica@ericasadun.com" target="_blank" class="">erica@ericasadun.com</a>&gt;</span><span class="">&nbsp;</span>wrote:<br class=""><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" class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jul 10, 2016, at 10:16 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><div class=""><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" 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.&nbsp;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="">&nbsp;<span class="">&nbsp;</span>// ...</div><div class="">&nbsp;<span class="">&nbsp;</span>continue</div><div class="">case B:</div><div class="">&nbsp;<span class="">&nbsp;</span>// ...</div><div class="">&nbsp;<span class="">&nbsp;</span>if C ~= x /* or y, or z, whichever is switched over */ {</div><div class="">&nbsp; &nbsp;<span class="">&nbsp;</span>continue</div><div class="">&nbsp;<span class="">&nbsp;</span>}</div><div class="">&nbsp;<span class="">&nbsp;</span>fallthrough</div></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">I'd say it would be fair to disallow continue and fallthrough to occur in the same clause</div></div></div></blockquote><div class=""><br class=""></div><div class="">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 class=""></div></div><div style="word-wrap:break-word" class=""><div class="">I do not understand. `break` is already implicit unless no other code is used.&nbsp;</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">case something:</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp;if condition { continue }</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp;// ends here. the compiler knows not to go forward and it's not an empty clause</font></div><div class=""><font face="Menlo" class="">case somethingElse:</font></div><br class=""><div class="">`fallthrough` means "ignore the next case statement and execute its clause".</div></div><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">-- E</div></div></blockquote></div>
</div></blockquote></div><br class=""></body></html>