[swift-evolution] Change 'for in' expression to for [] { (item) in ... }

eyerama eyerama at gmail.com
Fri Jul 28 18:41:50 CDT 2017


Thanks for all replies.

This is helpful for introduce why for in be that for in other peoples.

나의 iPhone에서 보냄

2017. 7. 29. 05:14 Taylor Swift <kelvin13ma at gmail.com> 작성:

> This is funny because this “expected behavior” is actually a heavily criticized part of C behavior. I think this change would cause just as much if not more confusion than it alleviates.
> 
>> On Fri, Jul 28, 2017 at 12:19 PM, Kwanghoon Choi via swift-evolution <swift-evolution at swift.org> wrote:
>> Hello
>> 
>> I found someone easy mistake using for in loop statement.
>> 
>> Ex)
>> var i = 0
>> for i in 0..<10 { }
>> print(i)
>> 
>> And this user expected print(i) is “10”
>> 
>> Many experienced swift developers doesn’t misunderstand like this. But always someone is new comers, and I think this expression make misunderstand easy too.
>> 
>> So why not like this?
>> 
>> var I = 0
>> for 0..<10 { (i) in … }
>> 
>> I think this is more understandable for loop expression.
>> 
>> Best Regards
>> 
>> - Jay Choi
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170729/0bd4d9d3/attachment.html>


More information about the swift-evolution mailing list