<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 5, 2016, at 12:37 PM, Marcelo Alves 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=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 5, 2016, at 16:06, Thorsten Seitz 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=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Am 05.01.2016 um 18:12 schrieb Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>&gt;:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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=""><blockquote type="cite" class=""><blockquote type="cite" class="">On Jan 5, 2016, at 12:29 AM, Thorsten Seitz via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">I once suggested the following ternary like switch:<br class=""><br class="">let x = color ?<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case .Red: 0xFF0000<br class="">&nbsp; &nbsp; &nbsp;case .Green: 0x00FF00<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case .Blue: 0x0000FF<span class="Apple-converted-space">&nbsp;</span><br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default: 0xFFFFFF<br class=""></blockquote><br class=""><br class=""></blockquote></blockquote></div></blockquote><div class=""><br class=""></div><div class="">Is anybody going to write up a proposal for the ternary-like switch expression?</div><div class=""><br class=""></div></div></div></div></blockquote><div class=""><br class=""></div>I’ll give it a try.</div></div></div></blockquote></div><br class=""><div class="">Any reason to not use switch let x = color … ? We already have if let, guard let, so I think switch let is pretty “swift-ly”.</div></div></div></blockquote><div><br class=""></div><div>Because this would only work when binding a name and not anywhere else. &nbsp;If that restriction is desired this might not be a bad idea. &nbsp;But if we want an expression that can be used anywhere it will not suffice.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">:: marcelo.alves</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=eLFMrKDT8iBxZ-2Fbnk-2BZqvSchNN-2FvYXdceA0T7VxwkAcgLFEptMQE8A9sdyFyAa-2F0hhizxwI2XBOAqzlnv5G3mQPL9begfw4IICJ9MJV3kNTa1b4Nv9x2BGtzA9eOtF3kpH-2B3kxGNeUneM9a9M-2F8NC840aagHWpPjbLPOHziADUblDAYn-2Be3AhqEfERZWCpljqB4kbj5A3XRPiWQeOaOAD-2FxJMk-2FaMG9N71piPzxhx2U-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" 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="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>