This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-28
Channels
- # beginners (79)
- # boot (24)
- # cider (5)
- # clara (5)
- # cljs-experience (5)
- # clojure (126)
- # clojure-greece (5)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-russia (1)
- # clojure-spec (21)
- # clojure-uk (31)
- # clojurescript (151)
- # community-development (20)
- # cursive (25)
- # datomic (24)
- # flambo (1)
- # fulcro (312)
- # graphql (10)
- # hoplon (20)
- # juxt (2)
- # keechma (6)
- # leiningen (7)
- # luminus (4)
- # om (4)
- # onyx (7)
- # parinfer (24)
- # protorepl (1)
- # re-frame (7)
- # reagent (13)
- # shadow-cljs (19)
- # spacemacs (14)
- # specter (14)
- # uncomplicate (22)
- # unrepl (1)
Hi, I remember I saw something somewhere about Specter supporting iteration over multiple sequences (like Clojure's map
does). Maybe, it was an explanation why Specter doesn't have this; anyway, I can't find the link. Can anyone help? A pointer how to work around this problem would be nice too. Thanks!
@alexyakushev no, Specter doesn't support that
besides questions of how to do a performant implementation of that, there's questions of semantics too
for instance, what would an ALL
transform on a vector and a map produce?
@nathanmarz Yeah, I thought it was something along these lines. map
was always an outlier among other sequence processing functions, it makes sense that Specter doesn't have it.
Regarding my problem, I need to merge
two lists of lists of lists of maps. Without Specter, I solved it with an abhorrent lasagna of (partial map ...)
. Can Specter help here somehow?
@alexyakushev unfortunately not
I had an idea open awhile ago that would have helped, or an extension of it https://github.com/nathanmarz/specter/issues/49
basically you locate
the specific paths to elements you care about, then use the element-specific path to get the corresponding value in the other data structure
locate
is complicated to implement especially for substructure navigators like srange
I hadn't thought before about how something like locate
would help with processing multiple data structures together
@nathanmarz Thanks! This is still quite helpful.
I ended up implementing something different than locate
as described in that ticket, but this might be worth considering again
Having a broader set of use cases would be needed to understand how to spec the new operation