@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 @sogaiu I’ll create a separate issue for these
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.