[CLJ-1095] Allow map-indexed to accept multiple collections (a la map) Created: 25/Oct/12 Updated: 08/Nov/12
|Patch:||Code and Test|
Bring external interface of map-indexed in line with map. Existing usages of map-indexed unchanged both in implementation and interface.
The attached patch is not necessarily the best implementation (I haven't benchmarked it or tried any alternatives yet) but hopefully enough to start a conversation about whether this is an addition that is warranted. I know I wished for this behavior a few weeks ago though I ended up finding another way.
(I haven't sent my CA yet, but I have it signed and ready to send in the next few days)
|Comment by Aaron Bedra [ 25/Oct/12 5:11 PM ]|
Can you add a test for the improved functionality?
|Comment by Bo Jeanes [ 25/Oct/12 5:20 PM ]|
You bet. I tried to before submitting this but found no existing tests for map-indexed to expand upon. Given that, I decided to just start the conversation first. If you think this is a good addition, I'll find a place to stick the tests and add a new patch file.
|Comment by Bo Jeanes [ 25/Oct/12 8:05 PM ]|
Add two unit tests for map-indexed. One tests old behavior (single collection) and the second tests mapping across 3 collections.
There were no existing tests for map-indexed that I could see to expand upon (using git grep map-indexed src/clojure)