More commonly used utilities
More commonly used utilities
(as-boolean s)
Returns a boolean represented by s. as-boolean returns true if s is "true" or "yes", ignoring case, false if "false" or "no", and nil otherwise.
Returns a boolean represented by s. as-boolean returns true if s is "true" or "yes", ignoring case, false if "false" or "no", and nil otherwise.
(as-double s)
Returns a new double number initialized to the value represented by s. as-double returns nil if s is an illegal string or nil.
Returns a new double number initialized to the value represented by s. as-double returns nil if s is an illegal string or nil.
(as-float s)
Returns a new float number initialized to the value represented by s. as-float returns nil if s is an illegal string or nil. as-float returns a double number if s is out of float range.
Returns a new float number initialized to the value represented by s. as-float returns nil if s is an illegal string or nil. as-float returns a double number if s is out of float range.
(as-int s)
Returns a new integer number initialized to the value represented by s. as-int returns nil if s is an illegal string or nil. as-long returns a long number if s is out of int range.
Returns a new integer number initialized to the value represented by s. as-int returns nil if s is an illegal string or nil. as-long returns a long number if s is out of int range.
(as-long s)
Returns a new long number initialized to the value represented by s. as-int returns nil if s is an illegal string or nil.
Returns a new long number initialized to the value represented by s. as-int returns nil if s is an illegal string or nil.
(as-rational s)
Returns a new rational number initialized to the value represented by s such as "1", "1/2", and "-1/2". as-rational returns nil if s is an illegal string, nil, or division by zero.
Returns a new rational number initialized to the value represented by s such as "1", "1/2", and "-1/2". as-rational returns nil if s is an illegal string, nil, or division by zero.
(bytes->hex data)
Convert byte array to hex string.
Convert byte array to hex string.
(clip x xmin xmax)
Limits x in the interval of [xmin xmax]. A value smaller than xmin becomes xmin, and a value larger than xmax becomes xmax. If nil is supplied to xmin/xmax, its side will not be limited.
Limits x in the interval of [xmin xmax]. A value smaller than xmin becomes xmin, and a value larger than xmax becomes xmax. If nil is supplied to xmin/xmax, its side will not be limited.
(hex->bytes data)
Convert hex string to bytes array.
Convert hex string to bytes array.
(random-string length)
Generate random string from alphabets and numbers (i.e. 0-9, A-Z, and a-z)
Generate random string from alphabets and numbers (i.e. 0-9, A-Z, and a-z)
(stack-trace-string e)
Returns a falattened string of stacktraces from an exception
Returns a falattened string of stacktraces from an exception
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close