<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">Am 22.12.2015 um 19:30 schrieb Félix Cloutier &lt;<a href="mailto:felixcca@yahoo.ca">felixcca@yahoo.ca</a>&gt;:<br></span></font><span style="background-color: rgba(255, 255, 255, 0);">This is essentially the latest proposal that Paul offered.</span><br></div><div>The most similar proposal in his last mail seemed to be the following:</div><div><br></div><div><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><blockquote type="cite" class=""><div class=""><div class=""><div class=""><font class="" color="#000000" style="background-color: rgba(255, 255, 255, 0);">let b = switch(colorEnum then .Red: 0xFF0000, .Green: 0x00FF00, .Blue: 0x00000FF, default: 0xFFFFFF)&nbsp;</font></div></div></div></blockquote></div></div></blockquote><br></div><div>This is quite different from the normal switch-syntax: parentheses instead of braces, "then" instead of "case" and only used once at the beginning while cases are separated by commas.</div><div><br></div><div>Apologies if I overlooked something.</div><div><br></div><div>-Thorsten</div><div><br></div><blockquote type="cite"><div><div class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; font-family: 'Lucida Grande'; line-height: normal; border-spacing: 0px;">Félix</span>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Le 22 déc. 2015 à 13:11:37, Thorsten Seitz &lt;<a href="mailto:tseitz42@icloud.com" class="">tseitz42@icloud.com</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""></div><div class="">I still don't understand why we are not simply writing</div><div class=""><br class=""></div><div class="">let i = switch color {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; case .Red: <span style="background-color: rgba(255, 255, 255, 0);" class="">0xFF0000</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; case .Green:&nbsp;0x00FF00</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; case .Blue:&nbsp;0x00000FF</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">&nbsp; &nbsp; }</span></div><div class=""><br class=""></div><div class="">No additional keywords, no wondering why different keywords and different syntax is used for something so similar. And not really longer than the alternative proposals (I do not count swapping "case" with "?" to be a gain, especially not if it requires to add a comma after each case).</div><div class=""><br class=""></div><div class="">-Thorsten&nbsp;</div><div class=""><br class=""></div><div class=""><br class="">Am 22.12.2015 um 15:31 schrieb Charles Constant via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">Just goofing on this a little. What if we called it a "which" statement, instead of a "switch" statement? It's a bit cutesy, but not too verbose, and it makes sense if you read it aloud.<div class=""><br class=""></div><div class=""><div class=""><div class=""><div class="">let i = which color {</div><div class=""><span class="" style="white-space:pre">        </span>? .Red: 0xFF0000,&nbsp;</div><div class=""><span class="" style="white-space:pre">        </span>? .Green: 0x00FF00,&nbsp;</div><div class=""><span class="" style="white-space:pre">        </span>? .Blue: 0x00000FF</div><div class="">}</div></div><div class=""><br class=""></div><div class=""><div class=""><div class="">let i = which boo {</div><div class=""><span class="" style="white-space:pre">        </span>? true: 1,&nbsp;</div><div class=""><span class="" style="white-space:pre">        </span>? false: 0,&nbsp;</div><div class=""><span class="" style="white-space:pre">        </span>? nil: -1</div><div class="">}</div></div><div class=""><br class=""></div></div></div></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1MXK54sosN3xru3iYcLt0oBZ2w20i49gyogXctgrspcFeBos2cSbOPMy-2FruZANF93GovHqZCaSQWuVeBQmDF154QE-2BS756vazUsGDDEUY3nC4OVvKq-2B4CCXjL0GLMmeCIrrqL34ybhIM4mfEd-2Bksy03TfNCZj3erqdyz1x1UI5U-2FAJBiHEIRFYTy17JmYwjx-2BlwIRNopGW6bYm-2BbDG-2BooVXcG8qiZz2m6xM-2BppTYbso-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></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></div></blockquote></div><br class=""></div></div></blockquote></body></html>