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

Jacob Bandes-Storch jtbandes at gmail.com
Sat Feb 27 15:06:03 CST 2016


Previous discussion:

https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001393.html

On Sat, Feb 27, 2016 at 12:52 PM, Rudolf Adamkovic via swift-evolution <
swift-evolution at swift.org> wrote:

> +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
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160227/157d8174/attachment.html>


More information about the swift-evolution mailing list