This is essentially the latest proposal that Paul offered.

Félix

> Le 22 déc. 2015 à 13:11:37, Thorsten Seitz <tseit...@icloud.com> a écrit :
> 
> I still don't understand why we are not simply writing
> 
> let i = switch color {
>         case .Red: 0xFF0000
>         case .Green: 0x00FF00
>         case .Blue: 0x00000FF
>     }
> 
> No additional keywords, no wondering why different keywords and different 
> syntax is used for something so similar. And not really longer than the 
> alternative proposals (I do not count swapping "case" with "?" to be a gain, 
> especially not if it requires to add a comma after each case).
> 
> -Thorsten 
> 
> 
> Am 22.12.2015 um 15:31 schrieb Charles Constant via swift-evolution 
> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>>:
> 
>> Just goofing on this a little. What if we called it a "which" statement, 
>> instead of a "switch" statement? It's a bit cutesy, but not too verbose, and 
>> it makes sense if you read it aloud.
>> 
>> let i = which color {
>>      ? .Red: 0xFF0000, 
>>      ? .Green: 0x00FF00, 
>>      ? .Blue: 0x00000FF
>> }
>> 
>> let i = which boo {
>>      ? true: 1, 
>>      ? false: 0, 
>>      ? nil: -1
>> }
>> 
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution@swift.org <mailto:swift-evolution@swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution 
>> <https://lists.swift.org/mailman/listinfo/swift-evolution>

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to