This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-23
Channels
- # admin-announcements (1)
- # arachne (3)
- # aws (1)
- # bangalore-clj (2)
- # beginners (209)
- # boot (81)
- # capetown (2)
- # cider (16)
- # clara (13)
- # cljsjs (16)
- # cljsrn (6)
- # clojure (217)
- # clojure-czech (1)
- # clojure-greece (4)
- # clojure-italy (3)
- # clojure-korea (3)
- # clojure-russia (3)
- # clojure-sg (3)
- # clojure-spec (104)
- # clojure-uk (23)
- # clojurescript (7)
- # component (7)
- # cursive (18)
- # datomic (12)
- # devcards (34)
- # dirac (17)
- # editors (3)
- # emacs (1)
- # events (1)
- # hoplon (62)
- # immutant (12)
- # incanter (1)
- # jobs (1)
- # klipse (2)
- # ldnclj (1)
- # luminus (1)
- # mount (1)
- # off-topic (8)
- # om (50)
- # onyx (46)
- # parinfer (5)
- # pedestal (4)
- # perun (2)
- # reagent (1)
- # rum (1)
- # schema (5)
- # specter (30)
- # untangled (5)
- # vim (46)
failing on the following providepath
:
(sp/declarepath map-walker)
(sp/providepath map-walker
[(sp/walker map?)
(sp/continue-then-stay sp/MAP-VALS map-walker)])
@caio what version of specter?
are you doing aot compilation?
could you open an issue for this? don't have time to look at it now
slightly gross:
(sp/transform [:parent sp/ALL #(= :children (first %)) sp/LAST] identity {:parent {:something {}}})
=> {:parent {:something {}}}
(sp/transform [:parent sp/ALL #(= :children (first %)) sp/LAST] identity {:parent {:something {} :children 1}})
=> {:parent {:something {}, :children 1}}
👍 gives me the correct result so not too gross. looks like i can drop the sp/LAST aswell.
(sp/transform [:parent sp/ALL #(= :children (first %))] identity {:parent {:something {}}})
=> {:parent {:something {}}}
(sp/transform [:parent sp/ALL #(= :children (first %))] identity {:parent {:something {} :children 1}})
=> {:parent {:something {}, :children 1}}
i'm still thinking there must be a cleaner way out there
must be a common enough scenario
i could have sworn i already unsuccessfully tried what i'm about to post..
(sp/transform [:parent sp/ALL (sp/selected? :children)] identity {:parent {:something {} }})
=> {:parent {:something {}}}
(sp/transform [:parent sp/ALL (sp/selected? :children)] identity {:parent {:something {},:children 1 }})
=> {:parent {:something {}, :children 1}}
but it works!
i'm looking at transform now and thinking maybe i should be wrapping everything in sp/selected?
(sp/transform [(sp/selected? :parent) (sp/selected? :children)] identity {:parent {:something {},:children 1 }})
=> {:parent {:something {}, :children 1}}
so if it doesn't exist, it's not created. not sure if that's sane or not?!
(sp/transform [(sp/selected? :parent) (sp/selected? :children)] identity {})
=> {}
not sure it's doing what you expect
(sp/transform [(sp/selected? :parent) (sp/selected? :children)] identity {})
=> {}
(sp/transform [(sp/selected? :parent) (sp/selected? :children)] identity {:parent nil})
=> {:parent nil}
(sp/transform [(sp/selected? :parent) (sp/selected? :children)] identity {:parent {:something nil}})
=> {:parent {:something nil}}
(sp/transform [(sp/selected? :parent) (sp/selected? :children)] identity {:parent {:something nil :children nil}})
=> {:parent {:something nil, :children nil}}
(sp/transform [(sp/selected? :parent) (sp/selected? :children)] (constantly 'foo) {:parent {:something nil :children nil}})
=> foo
you are correct...damn.!
(sp/transform [(sp/must :parent)] (constantly 'foo) {})
=> {}
(sp/transform [(sp/must :parent)] (constantly 'foo) {:parent {}})
=> {:parent foo}
(sp/transform [(sp/must :parent)] (constantly 'foo) {:parent {:children {}}})
=> {:parent foo}
(sp/transform [(sp/must :parent)] (constantly 'foo) {:parent {:children {} :foo nil
}})
=> {:parent foo}
(sp/transform [(sp/must :parent) (sp/must :children)] (constantly 'foo) {:parent {:children {} :foo nil}})
=> {:parent {:children foo, :foo nil}}
(sp/transform [(sp/must :parent) (sp/must :children)] (constantly 'foo) {:parent { :foo nil}})
=> {:parent {:foo nil}}
https://github.com/nathanmarz/specter/blob/master/src/clj/com/rpl/specter/navs.cljc#L421
super. that's the one.
thanks a lot