[swift-evolution] ternary operator ?: suggestion
Thorsten Seitz
tseitz42 at icloud.com
Tue Jan 5 12:06:29 CST 2016
> Am 05.01.2016 um 18:12 schrieb Matthew Johnson <matthew at anandabits.com>:
>
>>>>> On Jan 5, 2016, at 12:29 AM, Thorsten Seitz via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>>>>
>>>>> I once suggested the following ternary like switch:
>>>>>
>>>>> let x = color ?
>>>>> case .Red: 0xFF0000
>>>>> case .Green: 0x00FF00
>>>>> case .Blue: 0x0000FF
>>>>> default: 0xFFFFFF
>>>>
>>>>
>
> Is anybody going to write up a proposal for the ternary-like switch expression?
>
I’ll give it a try.
-Thorsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160105/594dada1/attachment.html>
More information about the swift-evolution
mailing list