Macros and functions for handling nil under various circumstances.
Macros and functions for handling nil under various circumstances.
(alt)
(alt x)
(alt x & xs)
Selects the first non-nil value, akin to the standard macro or
.
Ex. (dvlopt.void/alt nil false 42) => false
Selects the first non-nil value, akin to the standard macro `or`. Ex. (dvlopt.void/alt nil false 42) => false
(assoc-some hmap k v)
(assoc-some hmap k v & kvs)
Behaves like standard assoc
but only when the v
is not nil.
Behaves like standard `assoc` but only when the `v` is not nil.
(call f & args)
Calls f
with the given arguments only if f
is not nil.
Calls `f` with the given arguments only if `f` is not nil.
(last-existing)
(last-existing a)
(last-existing a b)
(last-existing a b c)
(last-existing a b c d)
(last-existing a b c d e)
(last-existing a b c d e f)
(last-existing a b c d e f g)
(last-existing a b c d e f g h)
(last-existing a b c d e f g h & xs)
Selects the rightmost non-nil argument.
It is a function useful for things such as merge-with
.
Selects the rightmost non-nil argument. It is a function useful for things such as `merge-with`.
(no-op)
(no-op _)
(no-op _ _)
(no-op _ _ _)
(no-op _ _ _ _)
(no-op _ _ _ _ _)
(no-op _ _ _ _ _ _)
(no-op _ _ _ _ _ _ _)
(no-op _ _ _ _ _ _ _ _)
(no-op _ _ _ _ _ _ _ _ & _)
Does absolutely nothing, but efficiently.
Does absolutely nothing, but efficiently.
(obtain k m1)
(obtain k m1 m2)
(obtain k m1 m2 m3)
(obtain k m1 m2 m3 m4)
(obtain k m1 m2 m3 m4 m5)
(obtain k m1 m2 m3 m4 m5 m6)
(obtain k m1 m2 m3 m4 m5 m6 m7)
(obtain k m1 m2 m3 m4 m5 m6 m7 m8)
(obtain k m1 m2 m3 m4 m5 m6 m7 m8 & ms)
Looks for a non-nil value using key k
on the given maps, in the given order.
Looks for a non-nil value using key `k` on the given maps, in the given order.
(select ks m1)
(select ks m1 m2)
(select ks m1 m2 m3)
(select ks m1 m2 m3 m4)
(select ks m1 m2 m3 m4 m5)
(select ks m1 m2 m3 m4 m5 m6)
(select ks m1 m2 m3 m4 m5 m6 m7)
(select ks m1 m2 m3 m4 m5 m6 m7 m8)
(select ks m1 m2 m3 m4 m5 m6 m7 m8 & ms)
Looks for a non-nil value for eack key in ks
, in the given maps, in the given order.
Looks for a non-nil value for eack key in `ks`, in the given maps, in the given order.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close