Liking cljdoc? Tell your friends :D

tawny.util


add-hookclj

(add-hook hook func)

Add func to hook.

Add func to hook.
sourceraw docstring

check-keysclj

(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
sourceraw docstring

clear-hookclj

(clear-hook hook)

Empty the hook.

Empty the hook.
sourceraw docstring

defmethodfcljmacro

(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.
sourceraw docstring

doforcljmacro

(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.
sourceraw docstring

domapclj

(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!
sourceraw docstring

fcall-no-nilclj

(fcall-no-nil f & args)

Calls f with args removing all nils in args

Calls f with args removing all nils in args
sourceraw docstring

groupifyclj

(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
sourceraw docstring

groupify-byclj

(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.
sourceraw docstring

groupify-except-atclj

(groupify-except-at value-keywords list)
source

has-keysclj

(has-keys hash thekeys)

Returns true iff hash has only thekeys in hash.

Returns true iff hash has only thekeys in hash.
sourceraw docstring

hashifyclj

(hashify list)

Takes a list with alternating keyword values and returns a hash

Takes a list with alternating keyword values and returns a hash
sourceraw docstring

hashify-except-atclj

(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
sourceraw docstring

in?clj

(in? seq elm)

true if seq contains elm

true if seq contains elm
sourceraw docstring

make-hookclj

(make-hook)

Make a hook.

Make a hook.
sourceraw docstring

onclj

(on val f)

Call f on val if val is not null.

Call f on val if val is not null.
sourceraw docstring

on-typecljmacro

(on-type type entity & rest)
source

quote-headcljmacro

(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.
sourceraw docstring

quote-treecljmacro

(quote-tree tree)

Given a tree of symbols, return a tree of names.

Given a tree of symbols, return a tree of names.
sourceraw docstring

quote-vectorcljmacro

(quote-vector v)
source

quote-wordcljmacro

(quote-word & symbols)

Given a list of symbols, return a list of names.

Given a list of symbols, return a list of names.
sourceraw docstring

quote-word-or-headcljmacro

(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.
sourceraw docstring

remove-hookclj

(remove-hook hook func)

Remove func from hook.

Remove func from hook.
sourceraw docstring

run-hookclj

(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.
sourceraw docstring

set-mapclj

source

tag-symbolcljmacro

(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.
sourceraw docstring

vectorizeclj

(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. 
sourceraw docstring

with-typescljmacro

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close