(check-keys hash thekeys)
Returns the hash or throws IllegalArgumentException if has does not have only thekeys in hash
Returns the hash or throws IllegalArgumentException if has does not have only thekeys in hash
(defmethodf multifn dispatch-val fn)
Creates and installs a new method of multimethod associated with dispatch-value. fn should be a function not a function body as with defmethod.
Creates and installs a new method of multimethod associated with dispatch-value. fn should be a function not a function body as with defmethod.
(dofor & body)
Unlazy dofor, for when the side effects are necessary. Unlike doseq this holds onto the head.
Unlazy dofor, for when the side effects are necessary. Unlike doseq this holds onto the head.
(domap & body)
Unlazy map function, for when the map function has side effects.
Typing (doall (map)) all the time is hard work!
Unlazy map function, for when the map function has side effects. Typing (doall (map)) all the time is hard work!
(fcall-no-nil f & args)
Calls f with args removing all nils in args
Calls f with args removing all nils in args
(groupify list)
Takes a list with keywords and values and turns all adjacent values into a single list
Takes a list with keywords and values and turns all adjacent values into a single list
(groupify-by pred list)
Takes a list by and turns adjacent values for which pred returns false into a single list, while leaving values for which pred returns true untouched. Values for which pred returns true must be separated by at least other value.
Takes a list by and turns adjacent values for which pred returns false into a single list, while leaving values for which pred returns true untouched. Values for which pred returns true must be separated by at least other value.
(has-keys hash thekeys)
Returns true iff hash has only thekeys in hash.
Returns true iff hash has only thekeys in hash.
(hashify list)
Takes a list with alternating keyword values and returns a hash
Takes a list with alternating keyword values and returns a hash
(hashify-except-at value-keywords list)
Takes a list with alternating keyword values and returns a hash
Takes a list with alternating keyword values and returns a hash
(on val f)
Call f on val if val is not null.
Call f on val if val is not null.
(quote-head l)
Given a vector, return vector with head converted to a name from a symbol.
Given a vector, return vector with head converted to a name from a symbol.
(quote-tree tree)
Given a tree of symbols, return a tree of names.
Given a tree of symbols, return a tree of names.
(quote-word & symbols)
Given a list of symbols, return a list of names.
Given a list of symbols, return a list of names.
(quote-word-or-head & v)
Given several items, return names for or heads converted to names for sequential items.
Given several items, return names for or heads converted to names for sequential items.
(remove-hook hook func)
Remove func from hook.
Remove func from hook.
(run-hook hook)
(run-hook hook & rest)
Run the hook with optional arguments. Hook functions are run in the order that they were added.
Run the hook with optional arguments. Hook functions are run in the order that they were added.
(tag-symbol tag form)
Given form, return the same form but with attached :tag metadata defining the return type of that form.
Given form, return the same form but with attached :tag metadata defining the return type of that form.
(vectorize f)
Given (f [x y]), return another function (g [x & rest]), where items in rest can be any tree structure, then, f with x and all values in rest.
Given (f [x y]), return another function (g [x & rest]), where items in rest can be any tree structure, then, f with x and all values in rest.
(with-types spec & body)
Given a spec of the form [symbol [types]] evaluate body if and only the value of symbol is an instance? of one of types. The symbol is type-hinted to the type of the first of types to match.
The main aim for this is to avoid reflective calls to overloaded methods in Java. So if we have an overloaded static method call:
C.met(String) C.met(Double) C.met(Boolean)
(with-types [val [String Double Boolean]] (C/met val)
will call met without reflection, so long as val is one of String, Double or Boolean. If none of the types are matched, an IllegalArgumentException will be thrown.
Given a spec of the form [symbol [types]] evaluate body if and only the value of symbol is an instance? of one of types. The symbol is type-hinted to the type of the first of types to match. The main aim for this is to avoid reflective calls to overloaded methods in Java. So if we have an overloaded static method call: C.met(String) C.met(Double) C.met(Boolean) (with-types [val [String Double Boolean]] (C/met val) will call met without reflection, so long as val is one of String, Double or Boolean. If none of the types are matched, an IllegalArgumentException will be thrown.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close