<div dir="ltr">I agree that it's simplest to just reuse switch keyword, and keep braces. +1. <div><br></div><div>Would you allow the same thing with if?<div><br></div><div>let thisColor = if condition { .Red } else { .Blue }</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 6, 2015 at 4:44 PM, Rudolf Adamkovic <span dir="ltr"><<a href="mailto:salutis@me.com" target="_blank">salutis@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> On 06 Dec 2015, at 22:35, thorsten--- via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
<br>
><br>
> I would prefer the expression to match the statement. The only difference would be that all parts that were statements now have to be expressions.<br>
<br>
</span>+1<br>
<span class=""><br>
><br>
> Therefore the switch-expression should simply look like follows:<br>
><br>
> let thisColor = switch thatColor {<br>
> case .Red: .Green // must be an expression<br>
> default: .Yellow // must be an expression<br>
> }<br>
><br>
> No returns needed in the case clauses.<br>
<br>
</span>This actually looks great. One simple rule and zero new keywords.<br>
<br>
Readable and simple to learn.<br>
<br>
Fantastic!<br>
<span class="im HOEnZb"><br>
> Formatting this as a one-liner would just require adding semicolons (though I wouldn't recommend this).<br>
><br>
> -Thorsten<br>
</span><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> swift-evolution mailing list<br>
> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>