[swift-evolution] ternary operator ?: suggestion

Charles Constant charles at charlesism.com
Sat Jan 9 19:58:42 CST 2016


* let num = color.**map {*
*.Red:* *100,*
* .**Green: * *200**,*
*.Blue: **300**,*
*_** : **-1*
* }*


Looks like I forgot to mention what my previous message regards: I mean
that if we go with "map", I prefer the version that doesn't require "case"
be written.

I also realize whether we're verbose enough depends on how commonly people
use this type of expression. If it is accepted, but unpopular, then I'd
concede "verbose" makes more sense.

Anyways, I'll try to lurk for a while now, instead of posting, as I'm
veering toward the bike-shed :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160109/f88ccea6/attachment.html>


More information about the swift-evolution mailing list