[swift-evolution] ternary operator ?: suggestion
possen at gmail.com
Fri Dec 18 18:56:28 CST 2015
Thanks for your support!
I think parenthesis are preferred because braces are for bracketing lists of statements. Statements may or may not return values.
Having the conditional on the inside of the parens helps to show the begging of the demux operator rather than a floating conditional which is a common complaint with the ternary operator.
> On Dec 18, 2015, at 3:46 PM, Charles Constant <charles at charlesism.com> wrote:
> I'd be very happy with your new proposal too. I still prefer sticking the value we're using as a key outside of the parens, but it's a minor quibble. Also I can't figure out if parens or curly braces are more appropriate. Does it make more sense for the expression to look like a tuple or a closure? I'm not sure.
> Anyhow, I'm good with your new proposal.
More information about the swift-evolution