This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-03
Channels
- # admin-announcements (2)
- # alda (4)
- # beginners (15)
- # boot (89)
- # cljs-dev (88)
- # cljsrn (75)
- # clojure (149)
- # clojure-belgium (16)
- # clojure-france (2)
- # clojure-greece (6)
- # clojure-russia (108)
- # clojure-spec (39)
- # clojure-taiwan (3)
- # clojure-uk (7)
- # clojurescript (70)
- # css (3)
- # cursive (17)
- # data-science (2)
- # datascript (7)
- # datomic (41)
- # dirac (3)
- # hoplon (12)
- # instaparse (1)
- # juxt (3)
- # lambdaisland (9)
- # mount (4)
- # off-topic (6)
- # om (71)
- # om-next (4)
- # onyx (22)
- # other-languages (56)
- # perun (15)
- # proton (6)
- # re-frame (32)
- # reagent (42)
- # specter (34)
- # spirituality-ethics (7)
- # tmp-json-parsing (5)
- # untangled (13)
- # vim (4)
- # yada (6)
hi, is recursive navigation supported under cljs in 0.11, I have troubles calling extend-protocolpath
and indeed it looks there is only #+clj implementation: https://github.com/nathanmarz/specter/blob/master/src/clj/com/rpl/specter/impl.cljx#L1085
protocol paths don't work in clojurescript version
you can still do recursive navigation without protocol paths
the last example on the README
(declarepath TreeValues)
(providepath TreeValues
(if-path vector?
[ALL TreeValues]
STAY
))
(transform [TreeValues even?] - [[1 2] [[3] 4] [6 [8 9 10]]])
;; => [[1 -2] [[3] -4] [-6 [-8 9 -10]]]
also look at continue-then-stay
and stay-then-continue
for doing post-order or pre-order traversals
I’m probably missing something, here is my current code, cannot make it work, want?
predicate is never called according to that log statement, I call filter-rep and then pprint it to string, so possible laziness should NOT prevent those calls, https://gist.github.com/darwin/9a2673fdb2448132c6d1908195df0932
yea, your path is incorrect
it only navigates you to elements of :children sequences that aren't maps
try this path:
(declarepath MyWalker)
(providepath MyWalker
(continue-then-stay
:children
ALL
MyWalker
))
that navigates you to every map
use multi-path
+ must
(declarepath MyWalker)
(providepath MyWalker
(continue-then-stay
(multi-path (must :children) (must :children2))
ALL
MyWalker
))
no problem
nice!
you can make it a little more concise like this:
(providepath MyWalker
(continue-then-stay
(multi-path
[(must :children) ALL]
(must :shadowRoot))
MyWalker))
getting some warnings when compiling specter’s impl namespace: https://gist.github.com/darwin/90bcb9a87d7f1b492cd6d6400bcd103c#file-impl-cljs-L3
not sure about bootstrap, but cljs.js should be cljs.core in my case, I’m not in bootstrapped environment
You can ignore the warnings, and they're fixed for the next version: https://github.com/nathanmarz/specter/issues/97
They have to do with code that's specifically for bootstrap cljs