This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-23
Channels
- # aws-lambda (1)
- # bangalore-clj (13)
- # beginners (12)
- # boot (3)
- # cider (1)
- # cljs-dev (20)
- # clojure (208)
- # clojure-finland (1)
- # clojure-france (1)
- # clojure-russia (30)
- # clojure-serbia (12)
- # clojure-spec (7)
- # clojure-uk (14)
- # clojurescript (16)
- # cursive (6)
- # datomic (10)
- # emacs (1)
- # hoplon (4)
- # keechma (14)
- # leiningen (2)
- # off-topic (6)
- # om (43)
- # onyx (32)
- # pedestal (8)
- # perun (2)
- # re-frame (7)
- # reagent (33)
- # specter (5)
- # vim (4)
- # yada (9)
@nathanmarz after seeing your excellent presentation this past week at the NYC Clojure meetup, I think specter could likely greatly help me in working with the output of a library I have that produces deeply nested maps of vectors. Mainly my issue is that built-in functions don't seem to go deep-enough into the nesting and rolling my own with walking has proven two difficult with all the filtering necessary. I'm using integer keys, which means I should probably switch to the int-map library for efficiency, but that doesn't seem like it would solve any of my major problems.
I'm currently mainly concerned with the following: 1. I'd like to stick with generating the data into an unsorted map for speed, but when I use (into (sorted-map) ...)
after the fact it oddly doesn't sort the deepest level of nesting. 2. Searching for values within the maps using some
similarly always returns nil as it doesn't seem to be searching deep enough. 3. Same when it comes to using filter
to eliminate empty vectors. 4. Same when trying to use vals
to eliminate keys entirely.
Although I can see how navigators like MAP-VALS
and NIL->VECTOR
would help with this, I'm having trouble figuring out from the API docs how to compose them to achieve these results. I know this is quite a bit, but any pointers on which functions/macros to look at would be greatly appreciated. Thanks!
@sophiago going to be easiest to help you by working through some specific examples
which navigators you need to compose for a use case depends entirely on the use case, a huge portion of specter's core navigators could be relevant for what you've described so far