This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-06
Channels
- # announcements (3)
- # aws (23)
- # beginners (61)
- # calva (57)
- # cider (121)
- # clara (1)
- # clj-kondo (9)
- # cljs-dev (62)
- # cljsrn (3)
- # clojure (79)
- # clojure-europe (2)
- # clojure-nl (19)
- # clojure-spec (9)
- # clojure-uk (14)
- # clojurescript (92)
- # clojureverse-ops (2)
- # cursive (3)
- # data-science (2)
- # duct (1)
- # figwheel (2)
- # graphql (6)
- # jobs (1)
- # kaocha (5)
- # leiningen (11)
- # off-topic (25)
- # overtone (1)
- # pedestal (4)
- # portkey (1)
- # re-frame (1)
- # remote-jobs (2)
- # shadow-cljs (179)
- # slack-help (3)
- # specter (7)
- # testing (14)
- # tools-deps (14)
- # unrepl (12)
- # vim (2)
- # yada (3)
If I am doing a transform with multi/path how can I refer to the las tthing selected before that path for example
(multi-transform [LAST
(multi-path [:a (terminal #_something-here-to-reference-LAST-object)]
[:b (terminal dec)])]
[1 2 3 4 5 {:a 1 :b 5 :c nil}])
how can In the terminal statement can I say "give me the LAST from the previous selector before I started branching off"
do I have ot just have a path that is like [(terminal #(update % :a some-fn (:c %)...)
(multi-transform [LAST
(multi-path [(terminal #(update % :a + (:b %)))]
[:b (terminal dec)]
[:c (terminal-val 123)])]
[1 2 3 4 5 {:a 1 :b 5 :c nil}])
seems to work but wonder if there's a more specter way of doing that@theeternalpulse use one of the value collection navs, like collect
or collect-one
Ah I see, now that makes the subsequent multipath fns have to take two arguments
no I tried it, nice solution, need to read through these again,
(multi-transform [LAST
(multi-path
[(collect-one :b) :a (terminal +)]
[:b (terminal dec)]
[:c (terminal-val 123)])]
[1 2 3 4 5 {:a 1 :b 5 :c nil}])