[swift-evolution] About "default" keyword in switch statement

星野恵瑠 el.hoshino at me.com
Mon Dec 5 22:11:12 CST 2016


p.s.

I've read this mail and totally understand that Swift is designed to be familiar with C family languages, which "default" is widely used.
https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md

But since Swift 3.0 has already make many source breaking changes and supports many features which most C family languages don't have, like labels in functions (except Objective-C, I guess), "inout" keyword in functions, etc, and one of Swift's goals is to make syntax "clear," hope we can re-consider the "default" keyword.

Thanks for your time.


> 2016/12/06 12:48、星野恵瑠 <el.hoshino at me.com> のメール:
> 
> Many languages have a switch statement and most (maybe all?) of them use "default" keyword for the condition which doesn't match any of those listed in the switch statement.
> 
> But sometimes that condition is just an exception, which literally IS NOT a default condition.
> 
> So how about using other keywords like "else" instead of "default"?



More information about the swift-evolution mailing list