(adjoin-onto left right)
Merge two data structures by combining the contents. For maps, merge recursively by adjoining values with the same key. For collections, combine the right and left using into or conj. If the left value is a set and the right value is a map, the right value is assumed to be an existence map where the value determines whether the key is in the merged set. This makes sets unique from other collections because items can be deleted from them.
Merge two data structures by combining the contents. For maps, merge recursively by adjoining values with the same key. For collections, combine the right and left using into or conj. If the left value is a set and the right value is a map, the right value is assumed to be an existence map where the value determines whether the key is in the merged set. This makes sets unique from other collections because items can be deleted from them.
(adjoin a b)
Merge two data structures by combining the contents. For maps, merge recursively by adjoining values with the same key. For collections, combine the right and left using into or conj. If the left value is a set and the right value is a map, the right value is assumed to be an existence map where the value determines whether the key is in the merged set. This makes sets unique from other collections because items can be deleted from them.
Merge two data structures by combining the contents. For maps, merge recursively by adjoining values with the same key. For collections, combine the right and left using into or conj. If the left value is a set and the right value is a map, the right value is assumed to be an existence map where the value determines whether the key is in the merged set. This makes sets unique from other collections because items can be deleted from them.
(copy-meta dest src)
Copy all the metadata from src to dest.
Copy all the metadata from src to dest.
(defm & defn-args)
Define a function with memoization. Takes the same arguments as defn.
Define a function with memoization. Takes the same arguments as defn.
(empty-coll? x)
Is x a collection and also empty?
Is x a collection and also empty?
(fail exception)
(fail string & args)
Raise an exception. Takes an exception or a string with format args.
Raise an exception. Takes an exception or a string with format args.
(if-ns ns-reference then-form & [else-form])
Try to load a namespace reference. If successful, evaluate then-form otherwise evaluate else-form.
Try to load a namespace reference. If successful, evaluate then-form otherwise evaluate else-form.
(into-set set map)
Update the given set using an existence map.
Update the given set using an existence map.
(invoke f)
(invoke f x)
(invoke f x & more)
Like clojure.core/apply, but doesn't expand/splice the last argument.
Like clojure.core/apply, but doesn't expand/splice the last argument.
(let-later bindings & body)
Behaves like let, but bindings which have :delay metadata on them are evaluated lazily, by placing their values in a delay and forcing the delay whenever the body of the let-later needs the value. For example,
(let-later [^:delay a (do-stuff)] (when (whatever) a))
will only evaluate (do-stuff) if (whatever) is true.
Behaves like let, but bindings which have :delay metadata on them are evaluated lazily, by placing their values in a delay and forcing the delay whenever the body of the let-later needs the value. For example, (let-later [^:delay a (do-stuff)] (when (whatever) a)) will only evaluate (do-stuff) if (whatever) is true.
(map-entry a b)
Create a clojure.lang.MapEntry from a and b. Equivalent to a cons cell. flatland.useful.experimental.unicode contains a shortcut to this, named ·.
Create a clojure.lang.MapEntry from a and b. Equivalent to a cons cell. flatland.useful.experimental.unicode contains a shortcut to this, named ·.
(memoize-deref vars f)
Returns a memoized version a non-referentially transparent function, calling deref on each provided var (or ref or atom) and using that in the cache key to prevent cross-contamination if any of the values change.
Returns a memoized version a non-referentially transparent function, calling deref on each provided var (or ref or atom) and using that in the cache key to prevent cross-contamination if any of the values change.
(or-max & args)
The maximium value of vals, ignoring nils.
The maximium value of vals, ignoring nils.
(or-min & args)
The minimium value of vals, ignoring nils.
The minimium value of vals, ignoring nils.
(pair a b)
Create a clojure.lang.MapEntry from a and b. Equivalent to a cons cell
Create a clojure.lang.MapEntry from a and b. Equivalent to a cons cell
(pop-if stack pred? & [default])
Pop item off the given stack if (pred? item) returns true, returning both the item and the modified stack. If (pred? item) is false, return nil or the optional default value.
Pop item off the given stack if (pred? item) returns true, returning both the item and the modified stack. If (pred? item) is false, return nil or the optional default value.
(queue)
(queue seq)
Create an empty persistent queue or a persistent queue from a sequence.
Create an empty persistent queue or a persistent queue from a sequence.
(read-seq)
Read all forms from in until an EOF is reached. Throws an exception on incomplete forms.
Read all forms from *in* until an EOF is reached. Throws an exception on incomplete forms.
(returning value & forms)
Compute a return value, then execute other forms for side effects. Like prog1 in common lisp, or a (do) that returns the first form.
Compute a return value, then execute other forms for side effects. Like prog1 in common lisp, or a (do) that returns the first form.
(split-vec v & ns)
Split the given vector at the provided offsets using subvec. Supports negative offsets.
Split the given vector at the provided offsets using subvec. Supports negative offsets.
(switch expr & clauses)
Like case, but uses object equality instead of the compile-time hash. Also, switch does not require a default clause. Of course, switch is not as efficient as case, but it works for things like functions, which case cannot support.
Like case, but uses object equality instead of the compile-time hash. Also, switch does not require a default clause. Of course, switch is not as efficient as case, but it works for things like functions, which case cannot support.
(syntax-quote form)
Syntax quote the given form, wrapping all seqs and symbols in quote.
Syntax quote the given form, wrapping all seqs and symbols in quote.
(thread-local & body)
Takes a body of expressions, and returns a java.lang.ThreadLocal object. (see http://download.oracle.com/javase/6/docs/api/java/lang/ThreadLocal.html).
To get the current value of the thread-local binding, you must deref (@) the thread-local object. The body of expressions will be executed once per thread and future derefs will be cached.
Note that while nothing is preventing you from passing these objects around to other threads (once you deref the thread-local, the resulting object knows nothing about threads), you will of course lose some of the benefit of having thread-local objects.
Takes a body of expressions, and returns a java.lang.ThreadLocal object. (see http://download.oracle.com/javase/6/docs/api/java/lang/ThreadLocal.html). To get the current value of the thread-local binding, you must deref (@) the thread-local object. The body of expressions will be executed once per thread and future derefs will be cached. Note that while nothing is preventing you from passing these objects around to other threads (once you deref the thread-local, the resulting object knows nothing about threads), you will of course lose some of the benefit of having thread-local objects.
(thread-local* init)
Non-macro version of thread-local - see documentation for same.
Non-macro version of thread-local - see documentation for same.
(update-peek stack f & args)
Update the element in stack that would be returned by peek, returning a new stack.
Update the element in stack that would be returned by peek, returning a new stack.
(verify test & args)
Raise exception unless test returns true.
Raise exception unless test returns true.
(with-adjustments adjustment bindings & body)
Create new bindings for binding args, by applying adjustment function to current values of bindings.
Create new bindings for binding args, by applying adjustment function to current values of bindings.
(with-timing & body)
Same as clojure.core/time but returns a vector of the result of the code and the milliseconds rather than printing a string. Runs the code in an implicit do.
Same as clojure.core/time but returns a vector of the result of the code and the milliseconds rather than printing a string. Runs the code in an implicit do.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close