Liking cljdoc? Tell your friends :D

tawny.util


add-hookclj

(add-hook hook func)

Add func to hook.

Add func to hook.
raw 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
raw docstring

clear-hookclj

(clear-hook hook)

Empty the hook.

Empty the hook.
raw docstring

doforclj/smacro

(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.
raw 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!
raw 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
raw docstring

groupify-atclj

(groupify-at keys list)

Takes a list and returns all adjacent values which are not in keys into a single list. Keys must be separated by at least one value.

Takes a list and returns all adjacent values which are not in keys into a
single list. Keys must be separated by at least one value.
raw 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.
raw docstring

has-keysclj

(has-keys hash thekeys)

Returns true iff hash has only thekeys in hash.

Returns true iff hash has only thekeys in hash.
raw 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
raw docstring

hashify-atclj

(hashify-at keys list)

Takes a list with alternating keyword values and returns a hash

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

in?clj

(in? seq elm)

true if seq contains elm

true if seq contains elm
raw docstring

make-hookclj

(make-hook)

Make a hook.

Make a hook.
raw docstring

onclj

(on val f)

Call f on val if val is not null.

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

on-typeclj/smacro

(on-type type entity & rest)

quote-headclj/smacro

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

quote-treeclj/smacro

(quote-tree tree)

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

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

quote-wordclj/smacro

(quote-word & symbols)

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

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

quote-word-or-headclj/smacro

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

remove-hookclj

(remove-hook hook func)

Remove func from hook.

Remove func from hook.
raw 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.
raw docstring

tag-symbolclj/smacro

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

with-typesclj/smacro

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

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

× close