[swift-evolution] [Proposal draft] Use obtain let instead if let construction

Rien Rien at Balancingrock.nl
Sun Jan 8 01:18:02 CST 2017


-1, ‘obtain' obfuscates the meaning of the “if” statement. Since it would (conceptually) introduce a new statement that is very similar to the ‘if’ statement and ‘guard’ statement it would probably cause even more confusion.

Regards,
Rien

Site: http://balancingrock.nl
Blog: http://swiftrien.blogspot.com
Github: http://github.com/Swiftrien
Project: http://swiftfire.nl




> On 08 Jan 2017, at 08:07, Carlos García via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I just realized my mistake in the example, I've corrected it
> 
>> On 08 Jan 2017, at 07:46, Carlos García <carlosypunto at gmail.com> wrote:
>> 
>> Hi Javier,
>> 
>> Maybe I’m not explained correctly in email. The change is not a "guard let”  replacement, instead it is a “if let” replacement.
>> 
>> Best,
>> Carlos
>> 
>>> On 08 Jan 2017, at 05:45, Javier Soto <javier.api at gmail.com> wrote:
>>> 
>>> Based on your examples I think you were thinking about the "guard" keyword, instead of "if"?
>>> 
>>> `If let foo = bar else` is not a valid construction. `if let foo = bar { } else {}` may have been what you meant, but in this case it is clear that this is just like a regular if, combined with unwrapping an optional.
>>> On Sat, Jan 7, 2017 at 7:12 PM thislooksfun via swift-evolution <swift-evolution at swift.org> wrote:
>>> -1 from me, I think that it makes perfect sense the way it is.
>>> 
>>> More specifically, I read `if let safe = optional` as "if optional can be unwrapped into safe, then ..."
>>> I think `obtain let` is more confusing, as it's not clear that it's a conditional from that keyword. Plus to me, "obtain" seems like it would be getting something from somewhere else, not always locally, maybe use an `unwrap` keyword in there somewhere, if you want it to be very clear what's happening?
>>> 
>>> -thislooksfun (tlf)
>>> 
>>>> On Jan 7, 2017, at 8:46 PM, Carlos García via swift-evolution <swift-evolution at swift.org> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> Here’s a draft proposal to change 
>>>> if let construction for obtain let. Proposal is at:
>>>> https://github.com/carlosypunto/swift-evolution/blob/obtain-let-instead-if-let/proposals/XXXX-Use-obtain-let-instead-if-let-constructions.md
>>>> 
>>>> 
>>>> I would like to see what you think and get help with "
>>>> Effect on ABI stability" and "Effect on API resilience
>>>> " points
>>>> 
>>>> Carlos
>>>> 
>>>> 
>>>> _______________________________________________
>>>> 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
>>> -- 
>>> Javier Soto
>> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list