[swift-evolution] Modernize Switch/Case Statements?
Howard Lovatt
howard.lovatt at gmail.com
Wed Jan 27 22:26:00 CST 2016
I think improvements to switch, if, for, and ?: have been ruled out in the
list of already requested but rejected changes.
On Thursday, 28 January 2016, Craig Cruden via swift-evolution <
swift-evolution at swift.org> wrote:
> Replacing a “:” with a set of curly brackets for each case would quickly
> clutter up the statement and make it look really ugly IMHO.
>
> If the problem is that the expression is being lost because the symbol “:”
> does not stand out…. then simple formatting tends to solve that (i.e. if it
> is multiple lines then “:” on one line and the code on the next.
>
>
> On 2016-01-28, at 8:43:25, Ilya Belenkiy via swift-evolution <
> swift-evolution at swift.org
> <javascript:_e(%7B%7D,'cvml','swift-evolution at swift.org');>> wrote:
>
> +1
> On Wed, Jan 27, 2016 at 8:39 PM Joseph Essin via swift-evolution <
> swift-evolution at swift.org
> <javascript:_e(%7B%7D,'cvml','swift-evolution at swift.org');>> wrote:
>
>> As a budding iOS developer, I thought it might be nice if Swift were to
>> further improve on C's *switch* statement by using curly brackets to
>> denote a block instead of a colon. It seems like this would be more
>> consistent with the language at large and make indention more intuitive.
>>
>> Here's a quick example of what it might be.
>>
>> switch *value* {
>> case *expression* {
>> }
>> }
>>
>> I apologize if this message isn't in the right format--I've not used a
>> mailing list before.
>>
>> Joseph Essin
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> <javascript:_e(%7B%7D,'cvml','swift-evolution at swift.org');>
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> <javascript:_e(%7B%7D,'cvml','swift-evolution at swift.org');>
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
>
--
-- Howard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160128/90f2c402/attachment.html>
More information about the swift-evolution
mailing list