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.
(compile-skeleton frame-sym skel)
Takes:
frame-sym
meant to reference a map of bindingsskel
and returns an unevaluated body that, when evaluated, will produce a form
structure of identical shape to skel
, with:
frame-sym
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.
(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`
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close