[swift-evolution] "if case" syntax is ugly

Chris Lattner clattner at apple.com
Sat Dec 5 10:52:34 CST 2015


> On Dec 5, 2015, at 5:14 AM, Amir Michail <a.michail at me.com> wrote:
> 
> Maybe instead of: if case 1...3 = x { … }
> 
> You could have: if x case 1..3 { … }
> 
> And loops could be handled similarly: for x case 1..3 in z { … }

Hi Amir,

It is hard to understand how your proposal would work.  Could you suggest a change to the formal grammar, which is described in the TSPL (https://swift.org/documentation/)?

-Chris


More information about the swift-evolution mailing list