CrossClj

0.6.1 docs

SourceDocs



RECENT
    VARS
    spec-collector
    spec-dispatch
    visit
    visit-spec

    « Index of all namespaces of this project

    Tools for walking spec definitions.
    
    (spec-collector)
    a visitor that collects all registered specs. Returns
    a map of spec-name => spec.
    Private
    (spec-dispatch spec accept options)
    (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
    * 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