In which is defined utility macros and functions that wrap the clojure.core functions to provide additional functionality or convenience.
In which is defined utility macros and functions that wrap the clojure.core functions to provide additional functionality or convenience.
(fmtstr format-in & args)
Provides a marginally more convenient form of clojure.pprint/cl-format
by
not requiring a writer to be specified when a formatted string is all that
is needed.
Provides a marginally more convenient form of `clojure.pprint/cl-format` by not requiring a writer to be specified when a formatted string is all that is needed.
(format writer format-in & args)
Replaces clojure.core/format
with clojure.pprint/cl-format
. Takes the
same arguments as [cl-format]; for details please refer to
the [documentation][cl-format] for that function.
[cl-format]: https://clojure.github.io/clojure/clojure.pprint-api.html#clojure.pprint/cl-format
Replaces `clojure.core/format` with `clojure.pprint/cl-format`. Takes the same arguments as [cl-format]; for details please refer to the [documentation][cl-format] for that function. [cl-format]: https://clojure.github.io/clojure/clojure.pprint-api.html#clojure.pprint/cl-format
(not-nil? x)
Equivalent to (not (nil? x))
, in a convenient form for use as a
predicate.
Equivalent to `(not (nil? x))`, in a convenient form for use as a predicate.
(returning [var val] & body)
Takes a single binding, executes forms
in the context of that
binding, and returns val
. Although similar in spirit to doto
,
it allows for arbitrary forms to be evaluated before returning
val
, and is thus closer to Ruby's tap
.
Takes a single binding, executes `forms` in the context of that binding, and returns `val`. Although similar in spirit to `doto`, it allows for arbitrary forms to be evaluated before returning `val`, and is thus closer to Ruby's `tap`.
(select-values m keyseq)
Returns a sequence of only the values in map
for which there keys in
keyseq
. Values are returned in the order in which the keys are
specified. nil
s are included for keys not present in the map; use (remove nil? (select-values ...))
to filter them out.
Returns a sequence of only the values in `map` for which there keys in `keyseq`. Values are returned in the order in which the keys are specified. `nil`s are included for keys not present in the map; use `(remove nil? (select-values ...))` to filter them out.
(single coll)
Returns the only element of a collection, and throws an exception if there is not exactly one element in the sequence.
Returns the only element of a collection, and throws an exception if there is not exactly one element in the sequence.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close