3 ms·
> Reduce can do all of the above, but must return a lower dimension result from its input. What do you mean by this? You can accumulate just about anything int
by DangitBobby 6y ago
> Reduce can do all of the above, but must return a lower dimension result from its input.
What do you mean by this? You can accumulate just about anything into the resulting object, including a copy of the original array.
- SamBam 6y agoI think it's just being confusingly stated. GP already said that reduce could implement map. I think it's merely that reduce can just output a single result, of any type. (Which is already more powerful than map, which must output an array.) Of course, in fact you could hack anything in any of these, since you could be doing other work in the function called. But I think the general principle is sound.
- thaumasiotes 6y ago> (Which is already more powerful than map, which must output an array.) Don't tell Common Lisp.