[swift-evolution] ternary operator ?: suggestion

Andrey Tarantsov andrey at tarantsov.com
Mon Dec 14 12:48:48 CST 2015


> Can you add to the proposal why a function cannot be added for tertiary expressions (under “Alternates Considered”):

That's one fresh idea, and I like it. I can't find anything wrong with it, except that fn doesn't need to be an @autoclosure, just a Bool.

I believe the customary name for that function is iff.

I always wrap ?: in parenthesis for readability anyway.

A.

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


More information about the swift-evolution mailing list