<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Ping.<div class=""><br class=""></div><div class="">What’s the latest on this proposal? Seems like a clear win to me. It seems the thread converged on a name if we want 2 versions of reduce. Should we simply replace the existing version so there’s only one?</div><div class=""><br class=""></div><div class="">Really wish this can get in Swift 4.</div><div class=""><div><blockquote type="cite" class=""><div class="">On Jan 25, 2017, at 1:06 AM, Chris Eidhof 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=""><div dir="ltr" class="">I like it too! Thanks Pyry! Will change the proposal.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jan 25, 2017 at 8:09 AM, David Hart via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class="">Yep, that's really good.</div><div class=""><div class="h5"><div class=""><br class="">On 25 Jan 2017, at 08:00, Jonathan Hull via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class="">+1 &nbsp;Best so far.<div class=""><br class=""></div><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 24, 2017, at 10:36 AM, Pyry Jahkola via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_6723889481789100091Apple-interchange-newline"><div class=""><div dir="auto" class=""><div class=""><span class=""></span></div><div class=""><div class=""><br class=""></div><div class="">Freak Show wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div class="">Am I the only one who finds this incredibly ugly and hard to read?</div><div class=""><br class=""></div><div class="">This is more or less solved by inject:into: idiom.&nbsp; There is no reason for inout for this particular problem.</div></div></blockquote><br class=""><div class="">Yeah, the original signature seems more useful. If you go all `inout` like Gwendal suggested, you might as well just iterate over the sequence with `for x in xs`, updating the state as you go.</div><div class=""><br class=""></div><div class="">But your comment brought another idea to mind: if `mutating:` is considered a bad name for a non-`inout` argument, how about `<b class="">reduce(into:combine:)`</b>, similar to what Karl suggested earlier in this thread?</div><div class=""><br class=""></div><div class="">I think it reads very well at the call site, does not suggest `inout`ness of the argument too much (of course there's no `&amp;` at the call site either), and it's still easily found with auto-completion:</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; let counts = words.reduce(into: [:]) {</div></div><div class="">&nbsp; &nbsp; &nbsp; $0[$1] = ($0[$1] ?? 0) + 1</div><div class="">&nbsp; &nbsp; }</div><div class=""><br class=""></div><div class="">— Pyry</div></div>______________________________<wbr class="">_________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div></blockquote><blockquote type="cite" class=""><div class=""><span class="">______________________________<wbr class="">_________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a></span><br class=""></div></blockquote></div></div></div><br class="">______________________________<wbr class="">_________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Chris Eidhof</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>