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 bindingsskeland returns an unevaluated body that, when evaluated, will produce a form
structure of identical shape to skel, with:
frame-symunquote 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 builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |