This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-14
Channels
- # beginners (183)
- # boot (6)
- # cider (106)
- # cljs-dev (17)
- # cljsjs (2)
- # cljsrn (2)
- # clojure (56)
- # clojure-italy (14)
- # clojure-nl (39)
- # clojure-spec (49)
- # clojure-uk (138)
- # clojurescript (197)
- # core-logic (37)
- # cursive (22)
- # datascript (5)
- # datomic (29)
- # devcards (18)
- # emacs (1)
- # events (8)
- # figwheel (1)
- # fulcro (59)
- # lein-figwheel (1)
- # leiningen (1)
- # off-topic (54)
- # onyx (3)
- # pedestal (1)
- # portkey (4)
- # re-frame (18)
- # reagent (5)
- # reitit (43)
- # ring (6)
- # ring-swagger (26)
- # shadow-cljs (42)
- # spacemacs (8)
- # specter (12)
- # sql (3)
- # tools-deps (21)
- # vim (18)
@jsa-aerial with walker
it's:
(let [replacements {:b 77 :x :xxx}]
(transform [(walker (complement coll?)) #(contains? replacements %)]
replacements
data
))
better than doing recursion manually in my opinion
💯 ah...
Hello, I have the following structure
and a function (get-details)
which does url -> [detailed-url1, detailed-url2 …]
What i need is the following
This is what Im using currently
(defn categorized-urls []
(->> (input)
(transform [ALL MAP-VALS ALL MAP-VALS ALL] get-details)
(transform [ALL MAP-VALS ALL MAP-VALS] flatten)))
Is there a better way?
The input structure is pretty huge and its taking a while to execute this. Was wondering there might be a better way than twice transforms.
@rahul080327 this will speed it up:
(defn categorized-urls [input]
(multi-transform
[ALL
MAP-VALS
ALL
MAP-VALS
(multi-path
[ALL (terminal get-details)]
(terminal #(into [] (mapcat identity) %)))]
input))
traverses the data structure once instead of twice
Ahan thanks a lot @nathanmarz superb 😃