Liking cljdoc? Tell your friends :D

criterium.utils.interface

Public API for the utils component.

Provides generic utilities including:

  • Assertion macros (have, have?)
  • Control flow macros (cond*)
  • Math utilities (sqr, sqrd, cubed, trunc)
  • Collection utilities (update-vals, filter-map, deep-merge)
  • Tree walking (walk, postwalk)
  • Debugging (spy, report)
Public API for the utils component.

Provides generic utilities including:
- Assertion macros (have, have?)
- Control flow macros (cond*)
- Math utilities (sqr, sqrd, cubed, trunc)
- Collection utilities (update-vals, filter-map, deep-merge)
- Tree walking (walk, postwalk)
- Debugging (spy, report)
raw docstring

assertion-errorclj

(assertion-error msg data)

Create an AssertionError with message and data, with stack trace adjusted to appear at assertion site.

Create an AssertionError with message and data, with stack trace adjusted
to appear at assertion site.
sourceraw docstring

assoc-tagclj

(assoc-tag sym t)

Associate a type tag to a symbol's metadata.

Associate a type tag to a symbol's metadata.
sourceraw docstring

cond*cljmacro

(cond* & clauses)

A cond variant that allows :let bindings visible to subsequent clauses.

A cond variant that allows :let bindings visible to subsequent clauses.
sourceraw docstring

cubedclj

(cubed x)

Cube of argument.

Cube of argument.
sourceraw docstring

deep-mergeclj

(deep-merge & ms)

Merge maps recursively.

Merge maps recursively.
sourceraw docstring

filter-mapclj

(filter-map pred m)

Filter map entries based on a predicate applied to values. Return a new map containing only entries where (pred value) returns true.

Filter map entries based on a predicate applied to values.
Return a new map containing only entries where (pred value) returns true.
sourceraw docstring

havecljmacro

(have x)
(have f x)
(have f x data)

Assertion macro inspired by truss. Returns argument if predicate succeeds, throws AssertionError otherwise.

Assertion macro inspired by truss.
Returns argument if predicate succeeds, throws AssertionError otherwise.
sourceraw docstring

have?cljmacro

(have? x & args)

Assertion macro inspired by truss. Returns true if predicate succeeds, throws AssertionError otherwise.

Assertion macro inspired by truss.
Returns true if predicate succeeds, throws AssertionError otherwise.
sourceraw docstring

postwalkclj

(postwalk f form)

Performs a depth-first, post-order traversal of form. Calls f on each sub-form, uses f's return value in place of the original.

Performs a depth-first, post-order traversal of form.
Calls f on each sub-form, uses f's return value in place of the original.
sourceraw docstring

provide-update-valscljmacro

(provide-update-vals)

Polyfill macro for update-vals

Polyfill macro for update-vals
sourceraw docstring

reduce-double-vectorclj

(reduce-double-vector f init v)

Reduce a double primitive value over a vector.

Reduce a double primitive value over a vector.
sourceraw docstring

reportclj

(report format-string & values)

Print format output.

Print format output.
sourceraw docstring

spyclj

(spy msg x)

Debug helper: print message and value, return value.

Debug helper: print message and value, return value.
sourceraw docstring

sqrcljmacro

(sqr x)

Square of argument (macro for inlining)

Square of argument (macro for inlining)
sourceraw docstring

sqrdclj

(sqrd x)

Square of argument (function).

Square of argument (function).
sourceraw docstring

truncclj

(trunc x)

Round towards zero to an integral value.

Round towards zero to an integral value.
sourceraw docstring

truthy?clj

(truthy? x)

Return true if x is neither nil nor false.

Return true if x is neither nil nor false.
sourceraw docstring

update-valsclj

(update-vals m f)

m f => {k (f v) ...}

Given a map m and a function f of 1-argument, returns a new map where the keys of m are mapped to result of applying f to the corresponding values of m.

m f => {k (f v) ...}

Given a map m and a function f of 1-argument, returns a new map where
the keys of m are mapped to result of applying f to the corresponding
values of m.
sourceraw docstring

update-vals-implclj

source

walkclj

(walk inner outer form)

Traverses form, an arbitrary data structure (preserves metadata). Applies inner to each element, building up a data structure of the same type, then applies outer to the result.

Traverses form, an arbitrary data structure (preserves metadata).
Applies inner to each element, building up a data structure of the same type,
then applies outer to the result.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close