Making associatvie array from array of pairs

monarch_dodra monarchdodra at gmail.com
Tue Dec 24 06:07:53 PST 2013


On Tuesday, 24 December 2013 at 12:33:13 UTC, Philippe Sigaud 
wrote:
> I don't know. I really consider `reduce` a nice way to collapse 
> a
> structure down to a value. I find it in many different places. 
> Sure,
> map and filter are more usual, but reduce is not far behind.

you use map and filter to reduce a structure down to a value? Or 
do you mean it's just something you use often?

I don't think map+filter can be used to "reduce" a range down to 
a value. It would require a filter with mutable state, and I'm 
pretty sure doing that means having an implementation defined 
result.


More information about the Digitalmars-d-learn mailing list