[swift-evolution] ternary operator ?: suggestion

Chris Lattner clattner at apple.com
Wed Dec 16 23:27:49 CST 2015

> On Dec 16, 2015, at 7:36 PM, Charles Constant <charles at charlesism.com> wrote:
> One more thought. This syntax would also placate ternary haters. I think the traditional complaint about ternary expressions is that people can't remember the order of the true and false values. This would not be an issue with:
>  let i = boo ? ( true: 123, false: 456 )

I would characterize this as “different” than ?:, but not better.  Given that it isn’t “better”, I’d argue that following C (and tons of other languages) would make sense here.


More information about the swift-evolution mailing list