4 ms·
`map` is strictly less "powerful" than a "loop", so I'd argue that's misleading. Which I'd also argue is a good thing. Using the least powerful construct avail
by akavi 7y ago
`map` is strictly less "powerful" than a "loop", so I'd argue that's misleading.
Which I'd also argue is a good thing. Using the least powerful construct available both communicates to future readers of the code, and allows higher level optimization (eg, `map` is trivially parallelizable, an arbitrary loop is not)
- thaumasiotes 7y agoBut `map` is not a primitive. It's just a function implemented with... a loop. It's hard to argue that that doesn't make it "some kind of loop".