Tools for walking spec definitions.
Tools for walking spec definitions.
(spec-collector)
a visitor that collects all registered specs. Returns a map of spec-name => spec.
a visitor that collects all registered specs. Returns a map of spec-name => spec.
(visit spec accept)
(visit spec accept {:keys [:spec-tools.visitor/visited] :as options})
Walk a spec definition. Takes 2-3 arguments, the spec and the accept function, and optionally a options map, and returns the result of calling the accept function. Options map can be used to pass in context- specific information to to sub-visits & accepts.
The accept function is called with 4 arguments: the dispatch term for the spec (see below), the spec itself, vector with the results of recursively walking the children of the spec and the options map.
The dispatch term is one of the following
Walk a spec definition. Takes 2-3 arguments, the spec and the accept function, and optionally a options map, and returns the result of calling the accept function. Options map can be used to pass in context- specific information to to sub-visits & accepts. The accept function is called with 4 arguments: the dispatch term for the spec (see below), the spec itself, vector with the results of recursively walking the children of the spec and the options map. The dispatch term is one of the following * if the spec is a function call: a fully qualified symbol for the function with the following exceptions: - cljs.core symbols are converted to clojure.core symbols - cljs.spec.alpha symbols are converted to clojure.spec.alpha symbols * if the spec is a set: :spec-tools.visitor/set * otherwise: the spec itself
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close