clojure.walk
(source)This file defines a generic tree walker for Clojure data
structures. It takes any data structure (list, vector, map, set,
seq), calls a function on every element, and uses the return value
of the function in place of the original. This makes it fairly
easy to write recursive search-and-replace functions, as shown in
the examples.
Note: "walk" supports all Clojure data structures EXCEPT maps
created with sorted-map-by. There is no (obvious) way to retrieve
the sorting function.
For more info about this library see:
https://clojuredocs.org/clojure.corePublic Variable | Short Description |
---|---|
keywordize-keys (clj) | Recursively transforms all map keys from strings to keywords. |
macroexpand-all (clj) | Recursively performs all possible macroexpansions in form. |
postwalk (clj) | Performs a depth-first, post-order traversal of form. |
postwalk-demo (clj) | Demonstrates the behavior of postwalk by printing each form as it is walked. |
postwalk-replace (clj) | Recursively transforms form by replacing keys in smap with their values. |
prewalk (clj) | Like postwalk, but does pre-order traversal. |
prewalk-demo (clj) | Demonstrates the behavior of prewalk by printing each form as it is walked. |
prewalk-replace (clj) | Recursively transforms form by replacing keys in smap with their values. |
stringify-keys (clj) | Recursively transforms all map keys from keywords to strings. |
walk (clj) | Traverses form, an arbitrary data structure. |