This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-03
Channels
- # adventofcode (91)
- # announcements (7)
- # aws (3)
- # babashka (69)
- # beginners (46)
- # calva (30)
- # cider (12)
- # clj-kondo (88)
- # cljs-dev (11)
- # cljsrn (1)
- # clojure (195)
- # clojure-dev (21)
- # clojure-europe (2)
- # clojure-italy (13)
- # clojure-nl (56)
- # clojure-spec (4)
- # clojure-sweden (6)
- # clojure-uk (27)
- # clojurescript (179)
- # core-async (2)
- # cryogen (1)
- # cursive (2)
- # data-science (1)
- # datomic (57)
- # fulcro (15)
- # graalvm (9)
- # instaparse (6)
- # joker (18)
- # juxt (9)
- # leiningen (6)
- # off-topic (20)
- # other-languages (10)
- # pathom (5)
- # re-frame (20)
- # reitit (2)
- # rewrite-clj (5)
- # shadow-cljs (78)
- # sql (34)
- # tools-deps (128)
- # uncomplicate (16)
- # vim (6)
@lee i just looked at: https://github.com/lread/rewrite-cljc-playground/issues/4 -- on a related note, i have things like:
(defn string-value
"Return the string value for a node."
[node]
(when-let [lines (:lines node)]
(cs/join "\n" lines)))
(defn string-node?
"Returns true if node represents a string, else false."
[node]
(string-value node))
(defn string?
"Returns true if zipper represents a string, else false."
[zloc]
(some-> zloc rz/node string-node?))
(defn symbol-value
"Return the symbol value for a node."
[node]
(:value node))
(defn symbol-node?
"Returns true if node represents a symbol, else false."
[node]
(clojure.core/symbol? (symbol-value node)))
(defn symbol?
"Returns true if zipper represents a symbol, else false."
[zloc]
(some-> zloc rz/node symbol-node?))
i don't know how well they are implemented, but i'm guessing other users of rewrite-clj* have written similar things.
(fwiw, i did look at: https://github.com/lread/rewrite-cljc-playground/blob/master/todos.org -- but didn't go through the code looking for todos 🙂 )
thanks! iiuc, clj-kondo has some things that are along these lines in: https://github.com/borkdude/clj-kondo/blob/master/src/clj_kondo/impl/utils.clj -- iiuc, borkdude doesn't currently use the zipper-related functionality so the relevant parts of that file are node-related.