Liking cljdoc? Tell your friends :D

clj-toolbox.prelude


any-in?clj

(any-in? pred coll)

Returns true if (pred x) is logical true for any x in coll, else false.

Returns true if (pred x) is logical true for any x in coll, else false.
sourceraw docstring

averageclj

(average coll)

Gets the average of every element in coll

Gets the average of every element in coll
sourceraw docstring

average-byclj

(average-by f coll)

Gets the average of (f x) for every x in coll

Gets the average of (f x) for every x in coll
sourceraw docstring

defnmemcljmacro

(defnmem name & fndef)

Defines a memoized function Examples: (defnmem fibonacci [x] (if (or (= 0 x) (= 1 x)) 1 (+ (fibonacci (- x 1)) (fibonacci (- x 2)))))

Defines a memoized function
 Examples:
  (defnmem fibonacci [x]
    (if (or (= 0 x)
            (= 1 x))
      1
      (+ (fibonacci (- x 1))
         (fibonacci (- x 2)))))
sourceraw docstring

derefable?clj

(derefable? x)

Returns true if x is an instance of clojure.langIDeref

Returns true if x is an instance of clojure.langIDeref
sourceraw docstring

find-firstclj

(find-first pred coll)

Returns the first x in coll for which (pred x) returns true. returns nil if none is found

Returns the first x in coll for which (pred x) returns true.
returns nil if none is found
sourceraw docstring

into-mapclj

(into-map coll)
(into-map kf coll)
(into-map kf vf coll)

Transforms coll into a hash-map by using (kf x) as the key and (vf x) as the value for each x in coll vf defaults to identity if not provided if only coll is provided, will assume coll is a list of pairs

Transforms coll into a hash-map by using (kf x) as the key and (vf x) as the value for each x in coll
vf defaults to identity if not provided
if only coll is provided, will assume coll is a list of pairs
sourceraw docstring

nowclj

(now)

Gets the time in milliseconds since unix epoch as a Long

Gets the time in milliseconds since unix epoch as a Long
sourceraw docstring

parse-intclj

(parse-int s)

Shortcut for Integer/parseInt to make it easier to pass around as an argument

Shortcut for Integer/parseInt to make it easier to pass around as an argument
sourceraw docstring

sumclj

(sum coll)

Gets the sum of every element in coll

Gets the sum of every element in coll
sourceraw docstring

sum-byclj

(sum-by f coll)

Gets the sum of (f x) for every x in coll

Gets the sum of (f x) for every x in coll
sourceraw docstring

update!clj

(update! m k f)

Like update, but for transients

Like update, but for transients
sourceraw docstring

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

× close