<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPad</div><div><br>On Jan 22, 2017, at 3:15 PM, Chris Lattner &lt;<a href="mailto:clattner@nondot.org">clattner@nondot.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 20, 2017, at 12:22 PM, Dave Abrahams via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="Singleton"><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; 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-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class="">Yeah, maybe there's a more general language feature that could replace 'fallthrough' here. Instead<br class="">of labelling cases, we could support a 'reswitch' statement that redispatches the switch to the case<br class="">matching the operand:<br class=""><br class="">&nbsp;&nbsp;&nbsp;switch some_value {<br class="">&nbsp;&nbsp;&nbsp;case .REFINED:<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if !validate(some_value) { return NULL }<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reswitch .BASE<br class=""><br class="">&nbsp;&nbsp;&nbsp;case .BASE:<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handle_enum_value();<br class="">&nbsp;&nbsp;&nbsp;}<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; 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=""><span style="font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">We should just call a spade a spade and spell that "goto" ;-)</span><br class=""></div></div></blockquote><br class=""></div><div>Goto has traditionally been used for unstructured control flow, but this form is still fully structured. &nbsp;You cannot produce irreducible loops, jump into scopes, over declarations, etc.</div></div></blockquote><div><br></div>It would be useful to know the technical definition of "structured." The fact is that there's a large category of sensible goto-like jumps that we probably want to allow and I see no advantage to giving them all distinct names. &nbsp;I don't believe users will distinguish them. &nbsp;We already have "break looplabel" and, aside from the label being in the wrong place, it's effectively a goto. &nbsp;It seems to me we should just have goto and either prohibit the troublesome uses or give them reasonable semantics.<div><div><br></div><div>I could live with "break" as well as "goto", but it feels a bit like it's pretending to be something it isn't, and there's the source compatibility problem with the label position.</div><div><br></div></div><div>-Dave</div></body></html>