[swift-evolution] [Idea] Deprecate the 'default' keyword.

Rudolf Adamkovic salutis at me.com
Sat Feb 27 14:52:56 CST 2016


+1 (as always) for replacing "default" with "case _".

It's consistent with other uses of "_", teaches about the concept of "_", simplifies the language vocabulary, frees "default" to be used as a case and it also looks better. :)

R+

Sent from my iPhone

> On 27 Feb 2016, at 15:31, Ross O'Brien via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Let's make this a topic of its own.
> 
> As mentioned recently in the '[Idea] Allowing most keywords after "."' thread, the 'default' keyword is only used as a keyword in switch statements, where it's synonymous with 'case _:'.
> It's also the kind of word which appears commonly in enums.
> 
> So, why do we need to keep it as a keyword?
> 
> Disadvantages: there would be some breaking of code, but a migration tool should have little difficulty replacing 'default:' with 'case _:' in all cases.
> 
> Alternatives: replace 'default' with 'else'.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list