[swift-evolution] ternary operator ?: suggestion
J. Cheyo Jimenez
cheyo at masters3d.com
Fri Dec 11 22:35:55 CST 2015
2) "then" would serve a way to differentiate the If statement and an if
1) I think that making an if-then expression would be less problematic than
making all if else statements into expressions. It was really easy for rust
to just drop ?: because they already had *if* as an expression but in swift
the *if* is a statement.
In swift we have if let and if case; adding if then to handle ternary
operations is probably no so bad.
On Fri, Dec 11, 2015 at 5:58 PM, Andrey Tarantsov via swift-evolution <
swift-evolution at swift.org> wrote:
> I actually agree; I like 'then' in CoffeeScript which is used for the same
> purpose there.
> 1) this is a bigger change than just a ternary operator
> 2) if we add "then", I believe that both forms should be acceptable for
> both kinds of IF statements
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution