Liking cljdoc? Tell your friends :D

clojure.contrib.djui.coll

Collection helper functions.

Collection helper functions.
raw docstring

alternateclj

(alternate n coll)

Return a list of lists containing the items coll modulo n.

Return a list of lists containing the items coll modulo n.
sourceraw docstring

any-true?cljdeprecated

(any-true? coll)

Returns a boolean if any value in coll is logically true. Deprecated: Use (any? coll).

Returns a boolean if any value in coll is logically true.
Deprecated: Use (any? coll).
sourceraw docstring

any?clj

(any? coll)
(any? pred coll)

Returns a boolean representing if any value in coll is true. If pred is given, return if any value in coll satisfies pred.

Returns a boolean representing if any value in coll is true. If pred is
given, return if any value in coll satisfies pred.
sourceraw docstring

create-mapcljmacro

(create-map & vars)

Return a map with a list of variable's name as keys and the variable's values as value.

Return a map with a list of variable's name as keys and the variable's
values as value.
sourceraw docstring

deep-mergeclj

(deep-merge & vals)

Like merge, but merges maps recursively. If vals are not maps, the last value wins.

Like merge, but merges maps recursively. If vals are not maps, the last value
wins.
sourceraw docstring

deep-merge-withclj

(deep-merge-with f & vals)

Like merge-with, but merges maps recursively. If vals are not maps, (apply f vals) determines the winner.

Like merge-with, but merges maps recursively. If vals are not maps,
(apply f vals) determines the winner.
sourceraw docstring

distinct-byclj

(distinct-by ident coll)

Like distinct, but using ident as the identity function for elements.

Example: (distinct-by :b [{:a 2, :b 7} {:a 3, :b 7} {:a 4, :b 8}]) => [{:a 2, :b 7} {:a 4, :b 8}]) (distinct-by second [[:a 2] [:b 2] [:b 3]]) => [[:a 2] [:b 3]] (= (distinct-by identity [1 1 2 3 4 4 5]) (distinct [1 1 2 3 4 4 5])) => true

Like distinct, but using ident as the identity function for elements.

Example:
(distinct-by :b [{:a 2, :b 7} {:a 3, :b 7} {:a 4, :b 8}])
  => [{:a 2, :b 7} {:a 4, :b 8}])
(distinct-by second [[:a 2] [:b 2] [:b 3]])
  => [[:a 2] [:b 3]]
(= (distinct-by identity [1 1 2 3 4 4 5]) (distinct [1 1 2 3 4 4 5]))
  => true
sourceraw docstring

gapmapclj

(gapmap f coll)

Returns a lazy sequence consisting of the result of applying f to all adjacent values of coll. f should be a function taking 2 arguments. If coll contains less than 2 items, it is returned and f is not called.

Returns a lazy sequence consisting of the result of applying f to all
adjacent values of coll. f should be a function taking 2 arguments. If coll
contains less than 2 items, it is returned and f is not called.
sourceraw docstring

pjuxtclj

(pjuxt & fns)

Like juxt, but parallelized.

Like juxt, but parallelized.
sourceraw docstring

pmapcatclj

(pmapcat f & colls)

Like mapcat but with parallelized map.

Like mapcat but with parallelized map.
sourceraw docstring

sequential!cljdeprecated

(sequential! x)

Ensure x is sequential. If x is nil, nil is returned. Deprecated, use to-sequence instead.

Ensure x is sequential. If x is nil, nil is returned.
Deprecated, use to-sequence instead.
sourceraw docstring

sort-maps-byclj

(sort-maps-by coll & ks)

Sort a collection of maps on multiple keys. Items with a missing key have precedence.

Example: (sort-maps-by [{:a 2 :b 2} {:a 1} {:a 2 :b 1}] :a :b) => [{:a 1 :b 2} {:a 2 :b 1} {:a 2 :b 2}]

Sort a collection of maps on multiple keys. Items with a missing key have
precedence.

Example:
(sort-maps-by [{:a 2 :b 2} {:a 1} {:a 2 :b 1}] :a :b)
  => [{:a 1 :b 2} {:a 2 :b 1} {:a 2 :b 2}]
sourceraw docstring

to-listclj

(to-list x)

Like list, but (to-list nil) returns nil.

Like list, but (to-list nil) returns nil.
sourceraw docstring

to-sequenceclj

(to-sequence x)

Like sequence, but (to-sequence nil) returns nil.

Like sequence, but (to-sequence nil) returns nil.
sourceraw docstring

to-vectorclj

(to-vector x)

Like vector, but (to-vector nil) returns nil.

Like vector, but (to-vector nil) returns nil.
sourceraw docstring

tree-seq+clj

(tree-seq+ branch?
           children
           root
           &
           [{:keys [parallel? limit]
             :or {parallel? true limit Double/POSITIVE_INFINITY}}])

Like tree-seq but, optionally, parallelized and with max. traversion limit.

Like tree-seq but, optionally, parallelized and with max. traversion limit.
sourceraw docstring

unitclj

(unit coll)

Returns the value in a collection if it only contains one item; also know as singleton.

Returns the value in a collection if it only contains one item; also know as
singleton.
sourceraw docstring

|>cljdeprecated

(|> & args)

Piping/Thrushing, similar to F#'s or OCaml |>, or Haskells $. Limitations: Args are not evaluated lazily and functions can only take one argument (as last argument). Deprecated with Clojure 1.5, use clojure.core/-> or clojure.core/->> instead.

Piping/Thrushing, similar to F#'s or OCaml |>, or Haskells $.
Limitations: Args are not evaluated lazily and functions can only take one
argument (as last argument).
Deprecated with Clojure 1.5, use clojure.core/-> or clojure.core/->> instead.
sourceraw docstring

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

× close