<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I very much agree with your concerns about this change in general.<div class=""><br class=""></div><div class="">On this specific example, though, I just wanted to point out that there doesn’t seem to be a good reason to use .forEach here.</div><div class=""><br class=""></div><div class="">for (key, value) in self {</div><div class="">&nbsp; // etc</div><div class="">}</div><div class=""><br class=""></div><div class="">Would work perfectly well and is clearer IMO, still works with destructing, doesn’t have gotcha problems related to continue/break not doing what you might expect, etc.&nbsp;</div><div class=""><br class=""></div><div class="">forEach is only really a win when used on the end of a chain of map/filter-like operations, where for…in would involve bouncing back from right to left.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 24, 2017, at 12:12 PM, Tony Parker via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi everyone,<div class=""><br class=""></div><div class="">We received a pull request in swift-corelibs-foundation which is apparently in response to a language change for SE-0110.</div><div class=""><br class=""></div><div class="">It turns this perfectly reasonable code:</div><div class=""><div class=""><br class=""></div><div class=""><font face="Menlo" class="">- &nbsp; &nbsp; &nbsp; &nbsp;self.forEach&nbsp;{ (keyItem, valueItem)&nbsp;in</font></div><div class=""><br class=""></div><div class="">into this:</div><div class=""><br class=""></div><div class=""><br class=""><font face="Menlo" class="">+ &nbsp; &nbsp; &nbsp; &nbsp;self.forEach&nbsp;{ (arg)&nbsp;in<br class="">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;let&nbsp;(keyItem, valueItem)&nbsp;=&nbsp;arg<br class=""></font><br class="">Is that really the design pattern we want to encourage? What was wrong with the previous code?</div><div class=""><br class=""></div><div class="">(<a href="https://github.com/apple/swift-corelibs-foundation/pull/995/files" class="">https://github.com/apple/swift-corelibs-foundation/pull/995/files</a>)</div></div><div class=""><br class=""></div><div class="">- Tony</div><div class=""><br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>