Predicate wrapper for sinho's structural matcher.
(pred f) wraps a 1-arg predicate for use in expected positions.
Bare functions in expected positions are compared by value equality,
not interpreted as predicates. This eliminates ambiguity between
'predicate-on-actual' and 'literal function-value equality.'
Predicate wrapper for sinho's structural matcher. `(pred f)` wraps a 1-arg predicate for use in expected positions. Bare functions in expected positions are compared by value equality, not interpreted as predicates. This eliminates ambiguity between 'predicate-on-actual' and 'literal function-value equality.'
(named-pred name f)Convenience: create a labelled predicate with a readable failure diff. Equivalent to (pred f name).
Convenience: create a labelled predicate with a readable failure diff. Equivalent to (pred f name).
(pred f)(pred f label)Wrap a 1-arg predicate for use in an expected position. Truthy result from (f actual) = match. Falsy = mismatch.
Arities: (pred f) - use (pr-str f) or fn metadata for failure label (pred f label) - explicit label for readable failure diffs
Wrap a 1-arg predicate for use in an expected position. Truthy result from (f actual) = match. Falsy = mismatch. Arities: (pred f) - use (pr-str f) or fn metadata for failure label (pred f label) - explicit label for readable failure diffs
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 |