[swift-evolution] Obsoleting `if let`
Chris Lattner
clattner at apple.com
Thu Feb 4 00:28:16 CST 2016
> On Feb 3, 2016, at 10:23 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>
>> The original proposal says
>>
>> if let name? = optionalCondition { }
>>
>> This would unwrap it?
>>
>> This seems like it should be mean the opposite.
>
> The reason it unwraps it is that the thing on the left is a pattern, kind of like the cases of a case statement:
Right. This makes sense to you, it makes sense to me, but it doesn’t make sense to most people using Swift. More specifically, you can get a *long* way in Swift without understanding the depth of how pattern matching works in Swift, but if/let is inescapable.
-Chris
More information about the swift-evolution
mailing list