[swift-evolution] ternary operator ?: suggestion

Chris Lattner clattner at apple.com
Wed Jan 20 11:13:39 CST 2016


> On Jan 20, 2016, at 8:22 AM, Thorsten Seitz <tseitz42 at icloud.com> wrote:
>>> I’m not sure I understand. What specific case do you mean and what composability is lost with the unary function approach?
>> 
>> I’m saying that tying closure expressions and switch expressions together makes it inconvenient when you want a local switch in a non-function context.
> 
> I'm sorry, but I'm afraid I still don't understand. Using the global match() function you can easily provide the function context and place the switch locally everywhere an expression is possible.

Ah, that is what I missed.  I thought that you were proposing match to be a keyword, not a standard library function.  Ok, I see how it fits together now.

-Chris



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160120/f9eaa680/attachment.html>


More information about the swift-evolution mailing list