This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-27
Channels
- # admin-announcements (3)
- # beginners (26)
- # boot (12)
- # cider (1)
- # cljs-dev (13)
- # cljsjs (101)
- # cljsrn (5)
- # clojure (64)
- # clojure-android (1)
- # clojure-gamedev (1)
- # clojure-greece (23)
- # clojure-nl (9)
- # clojure-poland (2)
- # clojure-russia (3)
- # clojure-spec (11)
- # clojure-uk (159)
- # clojurescript (19)
- # component (1)
- # core-async (2)
- # cursive (2)
- # datascript (1)
- # datomic (2)
- # devcards (1)
- # events (1)
- # funcool (1)
- # hispano (1)
- # hoplon (24)
- # immutant (12)
- # jobs (1)
- # keechma (18)
- # lein-figwheel (2)
- # leiningen (2)
- # off-topic (8)
- # om (23)
- # onyx (4)
- # planck (26)
- # re-frame (149)
- # reagent (6)
- # ring-swagger (9)
- # spacemacs (1)
- # specter (33)
- # spirituality-ethics (11)
- # testing (10)
- # untangled (335)
- # utah-clojurians (3)
- # vim (3)
- # yada (46)
Lets say I have a tree, and I want to select all of the nodes n levels away from the root following a particular path, is there a smart way to define a navigator that would repeat n times?
I’ve noticed some talk of stateful navigators in here but wasn’t paying close attention, is this a case for that?
(declarepath deeper [i])
(defpathedfn deeper [i]
(if (= 0 i)
(keypath i)
(deeper (dec i))))
(select [(deeper 1)] [0 1 2 3])
ok, found an answer
(declarepath repeat-path [walk-path end-path i])
(defpathedfn repeat-path [walk-path end-path i]
(if (= 0 i)
end-path
[walk-path (repeat-path walk-path end-path (dec i))]))
(select [(repeat-path [:node/_children ALL] :db/id 3)] ptest)
other question, Figwheel doesn’t seem to like that I am declaring a path and then redefining it this way,
Figwheel: Compile Warning - repeat-path at line 105 is being replaced at line 107
anything to be done about this?@conaw: don't call declarepath
there, that's only for usage with providepath
@conaw: the defpathedfn
call works fine without it
This has made my life so much easier by the way. Today was an absolute joy because of it. Thank you.
good to hear
Has anyone had any issues using specter in an AOT’d uberjar? I’m using it to pull data out of my immutant request. It works fine when running with lein run, but when I run the uberjar, it errors when using the request with: java.lang.IllegalArgumentException: No implementation of method: :get_cell of protocol: #'com.rpl.specter.impl/PMutableCell found for class: clojure.lang.Var$Unbound
a few people have reported similar issues, I haven't looked into it
I'm not seeing the relevance of that
i can confirm that error, although it came up from something other than immutant
@adambros @jjcomer with what versions of clojure/specter did you see those errors?
iirc clj 1.8 and specter 0.11.0
correction: specter 0.11.2
cool, thanks
im pretty sure i didnt want unbound vars in my data, but it would fail on that if i typo’d a symbol
oh I think I know what the problem might be
@jjcomer @adambros do you get the error with specter 0.10.0?
i dont, which is why i havent upgraded yet
ok, that supports my hypothesis
@adambros @jjcomer I was able to reproduce it and fix it, give 0.12.0-SNAPSHOT a shot and let me know if it fixes it
just deployed 0.12.0-SNAPSHOT to clojars
@nathanmarz: I built a small repro and just tried with 0.12.0-SNAPSHOT and it worked.
@nathanmarz: awesome thanks!