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

Tim Vermeulen tvermeulen at me.com
Sat Feb 27 09:57:42 CST 2016


I kinda like Haskell’s “otherwise”, and it’s move obvious what it means than “default” from an English language point of view.

> 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