Liking cljdoc? Tell your friends :D

noahtheduke.splint.pattern


expand-specialsclj

(expand-specials pattern)
source

literal?clj

(literal? t)

Is a given simple-type a literal/non-special?

Is a given simple-type a literal/non-special?
sourceraw docstring

match-altclj

(match-alt ctx pattern)
source

match-bindingclj

(match-binding ctx bind form)

Pattern must be a symbol in ?x style already.

Pattern must be a symbol in ?x style already.
sourceraw docstring

match-optionalclj

(match-optional ctx pattern)
source

match-plusclj

(match-plus ctx pattern)
source

match-predclj

(match-pred ctx bind form pred)
source

match-singleclj

(match-single ctx items)

Checks multiple single-element values at once.

Instead of generating a big and like in v1, this rebinds ctx and the children-form for each pattern, returning nil if one of the patterns doesn't match and somewhat short-circuiting the rest of the checks.

Relies on the output of the single-element pattern functions and expects them to return the ctx object iff there's a match.

Checks multiple single-element values at once.

Instead of generating a big `and` like in v1, this rebinds ctx and the
children-form for each pattern, returning `nil` if one of the patterns
doesn't match and somewhat short-circuiting the rest of the checks.

Relies on the output of the single-element pattern functions and expects them
to return the ctx object iff there's a match.
sourceraw docstring

match-starclj

(match-star ctx pattern)
source

non-coll?clj

(non-coll? t)

Is a given simple-type a non-collection?

Is a given simple-type a non-collection?
sourceraw docstring

patterncljmacro

(pattern pattern)

Parse a provided pattern s-expression into a function that checks each element and sub-element of the form as a whole predicate. Makes semi-smart decisions about using let-bindings to avoid re-accessing the same value multiple times, adding type hints to rely on interop, and handles the complexities of the pattern DLS.

Returns a map or nil. If the provided pattern uses bindings, the map will have the bindings as keys.

Parse a provided pattern s-expression into a function that checks each
element and sub-element of the form as a whole predicate. Makes semi-smart
decisions about using let-bindings to avoid re-accessing the same value
multiple times, adding type hints to rely on interop, and handles the
complexities of the pattern DLS.

Returns a map or `nil`. If the provided pattern uses bindings, the map will
have the bindings as keys.
sourceraw docstring

read-dispatchclj

(read-dispatch pattern)
(read-dispatch _ctx pattern _form)

Same as [[simple-type]] except that :symbol and :list provide hints about their contents. Can be skipped by adding the metadata :splint/lit.

Same as [[simple-type]] except that :symbol and :list provide hints about
their contents. Can be skipped by adding the metadata `:splint/lit`.
sourceraw docstring

read-dispatch-symbolclj

(read-dispatch-symbol sym)

Return the special type of a special symbol, or :symbol if normal.

Return the special type of a special symbol, or :symbol if normal.
sourceraw docstring

read-formcljmultimethod

(read-form ctx pattern form)

Implementation of the main logic of pattern. Requires form and ctx symbols to be provided to allow for recursion.

Implementation of the main logic of [[pattern]]. Requires form and ctx
symbols to be provided to allow for recursion.
sourceraw docstring

seq-matchcljmacro

(seq-match ctx pattern form)
source

seq-match-stepclj

(seq-match-step ctx form fns)

Inspired by segment-matcher from pangloss/pattern.

Inspired by segment-matcher from pangloss/pattern.
sourceraw docstring

simple-seq-matchclj

(simple-seq-match ctx pattern form)
source

special?clj

source

variable-seq-matchclj

(variable-seq-match ctx pattern form)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close