This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-29
Channels
- # admin-announcements (4)
- # arachne (19)
- # aws-lambda (3)
- # beginners (10)
- # boot (166)
- # capetown (32)
- # carry (160)
- # cider (5)
- # cljs-dev (5)
- # cljs-edn (19)
- # cljsrn (1)
- # clojure (100)
- # clojure-belgium (2)
- # clojure-dev (8)
- # clojure-greece (13)
- # clojure-new-zealand (12)
- # clojure-poland (1)
- # clojure-russia (93)
- # clojure-sanfrancisco (2)
- # clojure-spec (133)
- # clojure-uk (52)
- # clojurescript (129)
- # cursive (32)
- # datomic (13)
- # defnpodcast (5)
- # devcards (6)
- # dirac (4)
- # emacs (12)
- # euroclojure (5)
- # events (2)
- # hoplon (19)
- # immutant (45)
- # keechma (17)
- # lein-figwheel (27)
- # off-topic (9)
- # om (30)
- # onyx (17)
- # other-languages (3)
- # planck (2)
- # proton (11)
- # re-frame (7)
- # reagent (4)
- # ring (8)
- # sim-testing (2)
- # spacemacs (4)
- # testing (2)
- # untangled (162)
- # utah-clojurians (1)
- # yada (80)
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
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 🙂
@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)