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}])