[swift-evolution] ternary operator ?: suggestion

Matthew Johnson matthew at anandabits.com
Tue Jan 5 12:10:02 CST 2016


> On Jan 5, 2016, at 12:06 PM, Thorsten Seitz <tseitz42 at icloud.com> wrote:
> 
> 
>> Am 05.01.2016 um 18:12 schrieb Matthew Johnson <matthew at anandabits.com <mailto: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.

Sounds good.  I’ll be happy to review a draft if you would find that helpful.

> 
> -Thorsten
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160105/4becc4be/attachment.html>


More information about the swift-evolution mailing list