<div dir="ltr">yes, swift already has forEach, but from my point of view, there is an uncomfortable part, like '(0..<10).forEach{}'. like Range type to need wrap it in parentheses for using forEach.<div><br></div><div>my suggestion is not replacing 'for in [] {}' to 'for [] {}'. Can not we have both? Of course, by erasing one before, it gave an environment to make cleaner code easier for developers like me.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-29 1:38 GMT+09:00 Robert Bennett <span dir="ltr"><<a href="mailto:rltbennett@icloud.com" target="_blank">rltbennett@icloud.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Isn’t this exactly like forEach, which is already in the language?<br>
<div class="HOEnZb"><div class="h5"><br>
> On Jul 28, 2017, at 12:32 PM, Jacob Williams via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> This change would also make it so that for loops follow the same format as all other closures with variables.<br>
><br>
> The downside is that this would break a TON of code. I don’t think that the amount of code this breaks would be worth the consistency. And as Alex mentioned, it is possible through .forEach<br>
><br>
><br>
>> On Jul 28, 2017, at 10:19 AM, Kwanghoon Choi via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>> Hello<br>
>><br>
>> I found someone easy mistake using for in loop statement.<br>
>><br>
>> Ex)<br>
>> var i = 0<br>
>> for i in 0..<10 { }<br>
>> print(i)<br>
>><br>
>> And this user expected print(i) is “10”<br>
>><br>
>> Many experienced swift developers doesn’t misunderstand like this. But always someone is new comers, and I think this expression make misunderstand easy too.<br>
>><br>
>> So why not like this?<br>
>><br>
>> var I = 0<br>
>> for 0..<10 { (i) in … }<br>
>><br>
>> I think this is more understandable for loop expression.<br>
>><br>
>> Best Regards<br>
>><br>
>> - Jay Choi<br>
>> ______________________________<wbr>_________________<br>
>> swift-evolution mailing list<br>
>> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
><br>
> ______________________________<wbr>_________________<br>
> swift-evolution mailing list<br>
> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
</div></div></blockquote></div><br></div>