[swift-evolution] [Idea] Deprecate the 'default' keyword.
Ross O'Brien
narrativium+swift at gmail.com
Sat Feb 27 15:32:11 CST 2016
Xiaodi, thanks for pointing that out. That's an unfortunate oversight.
Following on from Brent's comments, then... the proposal as is will
probably be rejected as before. Since I seem to have acted too quickly in
submitting it, do you think I should close it, or leave it so it can be
edited? Would editing it be as simple as pointing its link to the
discussion on allowing dot-keywords (since, apart from Tim's suggestion of
Haskell's "otherwise", everything argued in this thread is in that one), or
is more substantial editing required?
--Ross
On Sat, Feb 27, 2016 at 9:06 PM, Jacob Bandes-Storch via swift-evolution <
swift-evolution at swift.org> wrote:
> 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
>>
>
>
> _______________________________________________
> 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/5ef93d00/attachment.html>
More information about the swift-evolution
mailing list