Built-in Predicates
Number predicates
int/integer
Returns true if data is an integer.
finite
Returns true if data is a finite number.
number
Returns true if data is a number (can be double or integer).
odd
even
positive
Returns true if data is a number greater than zero.
negative
Returns true if data is anumber smaller than zero.
zero
Returns true if data is the number zero.
Why: To easily construct specs for >= 0
.
Type predicates
str/string
Returns true if data is a string.
fn
Returns true if data is a function.
Long-form function
not possible as it's a keyword.
sym/symbol
Returns true if data is a Symbol.
nil
Returns true if data is null or undefined.
bool/boolean
Returns true if data is a boolean.
date
Returns true if data is a Date.
obj/object
Returns true if data is a plain object.
array
Returns true if data is an Array.
set
Returns true if data is a Set.
Collection predicates
coll
Returns true if data is an Array or Set.