Support functions and macros.
Support functions and macros.
(bytes-to-string b)
Converts bytes into a string
Converts bytes into a string
(char-ranges->set & ranges)
Returns a set of characters defined as a collection of collections with start and stop character, e.g.: [\A \Z][\0 \9]
Returns a set of characters defined as a collection of collections with start and stop character, e.g.: [\A \Z][\0 \9]
(gen-digits num)
(gen-digits num rng)
Generates the given number of random digits and converts all into a single string. When the second argument is present it should be an instance of random number generator used to get the digits.
Generates the given number of random digits and converts all into a single string. When the second argument is present it should be an instance of random number generator used to get the digits.
(get-rand-int n)
(get-rand-int n rng)
Like rand-int but optionally uses random number generator.
Like rand-int but optionally uses random number generator.
(get-rand-nth v)
(get-rand-nth v rng)
Returns a random element of the given vector. When the second argument is present it should be an instance of random number generator used to get the random position.
Returns a random element of the given vector. When the second argument is present it should be an instance of random number generator used to get the random position.
(inferred-contains? coll k)
Just like the contains? but if the keyword is namespace-qualified it also checks if the collection contains the same keyword as its key but without a namespace.
Just like the contains? but if the keyword is namespace-qualified it also checks if the collection contains the same keyword as its key but without a namespace.
(inferred-get coll k)
(inferred-get coll k default)
Just like the get function but if the keyword is namespace-qualified it first attempts to look for the value associated with it. If that fails it uses the variant of the keyword without any namespace.
Just like the get function but if the keyword is namespace-qualified it first attempts to look for the value associated with it. If that fails it uses the variant of the keyword without any namespace.
(juxt-seq & functions)
Like juxt but returns a lazy sequence.
Like juxt but returns a lazy sequence.
(lazy-iterator-seq coll)
(lazy-iterator-seq coll iter)
Returns a lazy sequence as an interface to the given iterable Java object.
Returns a lazy sequence as an interface to the given iterable Java object.
(ns-infer ns-name k)
(ns-infer ns-name k use-infer)
Takes a string of namespace name and a keyword. If the given keyword is not namespace-qualified it returns a new keyword with the given namespace added. If the given keyword is already equipped with a namespace it returns it.
Takes a string of namespace name and a keyword. If the given keyword is not namespace-qualified it returns a new keyword with the given namespace added. If the given keyword is already equipped with a namespace it returns it.
(random-digits-len x iteration shrink-now)
(random-digits-len x iteration shrink-now rng)
For 0 or 1 it returns its argument. For other positive numbers it returns a random natural number from 1 to this number (inclusive) in 50% cases. In other 50% cases it returns its argument.
For 0 or 1 it returns its argument. For other positive numbers it returns a random natural number from 1 to this number (inclusive) in 50% cases. In other 50% cases it returns its argument.
(try-null & body)
Evaluates body and if NullPointerException exception is caught it returns nil. Otherwise it returns the value of last expression in the body.
Evaluates body and if NullPointerException exception is caught it returns nil. Otherwise it returns the value of last expression in the body.
(try-parse-int s)
Returns integer from an object or nil if the given object does not contain valid integer.
Returns integer from an object or nil if the given object does not contain valid integer.
(try-parse-long s)
Returns long from an object or nil if the given object does not contain valid long.
Returns long from an object or nil if the given object does not contain valid long.
(when-not-empty val & body)
Evaluates body when the given value is a non-empty collection.
Evaluates body when the given value is a non-empty collection.
(with-not-empty obj)
Returns the collection if it's not empty. Otherwise returns nil
.
Returns the collection if it's not empty. Otherwise returns `nil`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close