<div dir="ltr">I opened up a WIP PR on the SE repository (so many TLA&#39;s!). <a href="https://github.com/apple/swift-evolution/pull/587">https://github.com/apple/swift-evolution/pull/587</a><div><br></div><div>I think I&#39;ll wait a few days before removing `WIP` until the naming discussion either reaches consensus or settles down.</div><div><br></div><div>So far, I would summarize the thread as: people are in favor, but there is disagreement on the naming. I suspect the core team will ultimately decide on the naming?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 18, 2017 at 11:11 AM, Chris Eidhof <span dir="ltr">&lt;<a href="mailto:chris@eidhof.nl" target="_blank">chris@eidhof.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I don&#39;t think we should replace the current `reduce` with the `inout` version, also because the current reduce can be really useful as well (e.g. when the return type is an Int). <div><br></div><div>One downside of having a different name is that it&#39;ll be harder to discover this version. If stressing the type-checker is the only problem, then maybe we should improve the type-checker, instead of placing that burden on every user of the language.</div><div><div><br></div><div><br></div></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, Jan 18, 2017 at 9:36 AM, Karl Wagner via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div><div class="m_-7040241973466185661h5"><div>On 18 Jan 2017, at 09:00, Anton Zhilin via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-7040241973466185661m_-2796232354106425939Apple-interchange-newline"></div></div><div><div><div class="m_-7040241973466185661h5"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">While realizing that this name can cause confusion, I&#39;d still prefer `reduce(mutating:_:)`, because it looks like the only readable option to me.</div><div class="gmail_quote">Whatever name will be picked, I agree that traditional reduce without mutation should retain its name.</div><div class="gmail_quote"><br></div><div class="gmail_quote">2017-01-18 5:17 GMT+03:00 Xiaodi Wu via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">A serious possibility would be: `reduce(mutableCopyOf: x) { ... }`.<div><br></div><div>It&#39;s verbose, but the nicer-looking `reduce(mutating: x) { ... }` is incorrect since, as Charles pointed out to Dave, it&#39;s not `x` that&#39;s mutated but rather a mutable copy of it, so it doesn&#39;t matter if `x` itself is declared with `let` or `var`. </div></div></blockquote></div></div></div></div></div>
______________________________<wbr>_________________<span><br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br></span></div></blockquote></div><br><div>I suppose as a second-choice I’d go for accumulate(into: with:):</div><div><br></div><div>[1, 2, 3].accumulate(into: 0, with: +=) </div><div><br></div><div>even [1, 2, 3].accumulate(into: 0, with: -=) doesn’t look so bad IMO.</div><div><br></div><div>- Karl</div></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-7040241973466185661gmail_signature" data-smartmail="gmail_signature">Chris Eidhof</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Chris Eidhof</div>
</div>