> On Mar 20, 2016, at 1:26 PM, Tyler Fleming Cloutier via swift-evolution 
> <[email protected]> wrote:
> 
> Also as a brief aside, it’s not super intuitive to me that the syntax for the 
> catch pattern matching wildcard is 
> 
> catch _
> 
> whereas it is
> 
> default
>  
> for switches. I think I saw Chris mention somewhere that default was chosen 
> because of it’s wide familiarity. Does anyone recall the reason?

Yes, both `switch` and `default` were chosen because that's what other C-style 
languages use.

Note that `case _` is the same as `default` in `switch`, so you can use `case 
_` and `catch _` if you don't care about C-style appearance. 

I don't think anyone has proposed allowing `default` in place of `catch _`. 
There was an earlier discussion of removing `default` from `switch` and 
requiring `case _` instead (thread "Remove default case in switch-case" on 
swift-evolution).


-- 
Greg Parker     [email protected] <mailto:[email protected]>     Runtime 
Wrangler


_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to