<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div><br>Am 30.01.2016 um 10:39 schrieb Haravikk via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">I’d say to make it optional, as the use of just a colon is great for compact switch statements with short cases, so I think they’re worth retaining.</div><div class=""><br class=""></div></div></blockquote><div><br></div><div>+1</div><br><blockquote type="cite"><div><div class="">Actually, one thing we don’t have in Swift is the ability to just put blocks (curly braces) wherever we like, which in some languages is a useful tool for variable scope when you know you only need something for a short time, but might want to re-use the name. Currently they just result in a “trailing closure separated by multiple new-lines” warning, so they could perhaps be made available, in which event you could use them in larger case statements whenever you wished.</div></div></blockquote><div><br></div><div>Actually "do" can be used for variable scoping:</div><div><br></div><div>do {</div><div>&nbsp; &nbsp; let x = Something()</div><div>}</div><div>let x = SomethingElse()</div><div><br></div><div><br></div><div>- Maximilian</div><br><blockquote type="cite"><div><br class=""><div><blockquote type="cite" class=""><div class="">On 29 Jan 2016, at 22:45, Rudolf Adamkovič 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=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">+2 from me! One for curly braces and one for proper indentation.</div><div class=""><br class=""></div><div class="">R+</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 28 Jan 2016, at 02:35, Joseph Essin 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 dir="ltr" class="">As a budding iOS developer, I thought it might be nice if Swift were to further improve on C's <i class="">switch</i> statement by using curly brackets to denote a block instead of a colon. It seems like this would be more consistent with the language at large and make indention more intuitive.<div class=""><br class=""></div><div class="">Here's a quick example of what it might be.</div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">switch&nbsp;</span><i style="font-size:12.8px" class="">value</i><span style="font-size:12.8px" class="">&nbsp;</span><span style="font-size:12.8px" class="">{</span><br class=""></div><div class=""><div style="font-size:12.8px" class="">&nbsp; case&nbsp;<i class="">expression</i>&nbsp;{</div><div style="font-size:12.8px" class="">&nbsp; }</div><div style="font-size:12.8px" class="">}</div></div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">I apologize if this message isn't in the right format--I've not used a mailing list before.</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">Joseph Essin</div></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>