Liking cljdoc? Tell your friends :D

emmy.pattern.consequence

Code for defining and compiling 'consequence' functions, i.e., functions from a binding map generated by a [emmy.pattern.match] to some successful transformation (or a failure!).

See emmy.pattern.rule for a detailed treatment.

Code for defining and compiling 'consequence' functions, i.e., functions from a
binding map generated by a [[[emmy.pattern.match]]] to some successful
transformation (or a failure!).

See [[emmy.pattern.rule]] for a detailed treatment.
raw docstring

compile-skeletonclj/s

(compile-skeleton frame-sym skel)

Takes:

  • a symbol frame-sym meant to reference a map of bindings
  • a skeleton expression skel

and returns an unevaluated body that, when evaluated, will produce a form structure of identical shape to skel, with:

  • all variable binding forms replaced by forms that look up the binding in a map bound to frame-sym
  • same with any segment binding form, with the added note that these should be spliced in
  • any unquote or unquote-splicing forms respected.
Takes:

- a symbol `frame-sym` meant to reference a map of bindings
- a skeleton expression `skel`

and returns an unevaluated body that, when evaluated, will produce a form
structure of identical shape to `skel`, with:

- all variable binding forms replaced by forms that look up the binding in a
  map bound to `frame-sym`
- same with any segment binding form, with the added note that these should
  be spliced in
- any `unquote` or `unquote-splicing` forms respected.
sourceraw docstring

succeedclj/s

(succeed x)

Wraps the argument x in a form that will always successfully return from a consequence function, whatever its value.

Use succeed to return nil or false from a consequence function. For all other return values, returning (succeed x) is identical to returning x

Wraps the argument `x` in a form that will always successfully return from a
consequence function, whatever its value.

Use [[succeed]] to return `nil` or `false` from a consequence function. For
all other return values, returning `(succeed x)` is identical to returning
`x`
sourceraw docstring

unwrapclj/s

(unwrap x)

Given a form returned by a consequence function, unwraps the top level succeed wrapper if present to return the final value.

Given a form returned by a consequence function, unwraps the top level
`succeed` wrapper if present to return the final value.
sourceraw docstring

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

× close