[swift-evolution] SE-0171: Reduce with inout

T.J. Usiyan griotspeak at gmail.com
Fri Apr 14 22:08:50 CDT 2017


+1 from me. I currently use reduce and just deal with the costs.

On Fri, Apr 14, 2017 at 10:15 PM, Matthew Johnson via swift-evolution <
swift-evolution at swift.org> wrote:

>
> > On Apr 14, 2017, at 9:05 PM, David Sweeris <davesweeris at mac.com> wrote:
> >
> >
> >> On Apr 14, 2017, at 15:33, Matthew Johnson via swift-evolution <
> swift-evolution at swift.org> wrote:
> >>
> >>
> >>>   • What is your evaluation of the proposal?
> >>
> >> +0.5 because this is a half solution.  I would also like to see a
> variant which accepts an inout argument for the reduction to accumulate
> into.
> >
> > Out of curiosity, do you have any particular use case in mind, or do you
> just think that'd nicely "round out" the reduce functions (which would be
> fine with me).
>
> This would be useful in any use case that involves reducing data that
> isn’t all available at the same time for one reason or another (batches
> arrive periodically, data is processed in chunks to avoid loading
> everything into memory, etc).
>
> IMO the most fundamental variation of `reduce` Swift could offer is the
> one that takes and `inout` accumulator.  The others can easily be defined
> in terms of that.
>
> >
> > - Dave Sweeris
>
> _______________________________________________
> 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/20170414/ff4264d5/attachment.html>


More information about the swift-evolution mailing list