This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-10
Channels
- # aws (45)
- # bangalore-clj (16)
- # beginners (109)
- # boot (137)
- # cider (7)
- # cljs-dev (54)
- # cljsrn (22)
- # clojure (77)
- # clojure-conj (1)
- # clojure-greece (2)
- # clojure-nl (5)
- # clojure-russia (36)
- # clojure-spec (15)
- # clojure-uk (54)
- # clojurescript (118)
- # cursive (7)
- # datomic (25)
- # emacs (33)
- # hoplon (276)
- # klipse (38)
- # lein-figwheel (1)
- # leiningen (9)
- # melbourne (1)
- # off-topic (18)
- # om (98)
- # onyx (6)
- # pedestal (1)
- # perun (24)
- # re-frame (46)
- # reagent (6)
- # ring-swagger (3)
- # spacemacs (67)
- # specter (15)
- # untangled (33)
- # vim (6)
@nathanmarz Thanks for the help. It's very useful!
I have a probably numb question but is it possible in (transform PATH f val)
to make
the transformation somewhat depend on the application of val.
I give an example (on which I stumbled multiple times)...
Consider a map like this:
`
{ :a 2 :b 1 :c 3}
And I would like to e.g. decrement all VALS and, at the same time,
remove all the pairs whose value gets to 0, i.e. :
`(sorry for the very bad slack edits, I'm new here ;-)...
So I would like to obtain :
{ :a 1 :c 3}
and :b
is no more ...
Thanks in advance (and sorry again for the awfully bad typing above).
(plus I see that it's the middle of the night in the U.S. and no one's here ;-). See you later then !
(oops)
To rephrase myself: is it possible in (transform PATH f val)
to make
the transformation somewhat depend on the application of f
?
@fredokun there's discussion of a feature for that here: https://github.com/nathanmarz/specter/issues/117
you could always make that navigator yourself
keypath
, MAP-VALS
, and ALL
could have that functionality