Fork me on GitHub

One helper function I’ve needed many times is one I usually call index-by. Similar to group-by but with single values (and not a vector of values as in group-by). Usually I either throw on duplicate values or just let it have last-value-per-key-wins semantics. Is this (or similar) function something that could potentially get into clojure.core? Has it been discussed before?


@alexmiller: Looks kind of similar, but not exactly the same as my common use case

Alex Miller (Clojure team)14:06:55

you’re welcome to submit an enhancement but needs a lot more motivation and detail to make a strong case


I don’t think I can motivate it enough, but it came up again today.. so I just wanted to ask if others have needed this fn as well and wished it was in core 🙂


but it’s not a problem to have a local helper function for it either


@jonas: Yeah, we use that all over the place but we called it resultset->lookup because we always use it with java.jdbc stuff.


(It assumes last value wins in our version)