(border grid i)
grid
should be a rectangular collection of collections. Adds i
as a border around the supplied grid.
`grid` should be a rectangular collection of collections. Adds `i` as a border around the supplied grid.
(border-and-flatten grid i)
Borders grid
with i
and then makes it into a
one dimensional vector
Borders `grid` with `i` and then makes it into a one dimensional vector
(borderv grid i)
grid
should be a rectangular collection of collections. Adds i
as a border around grid
. Return a vector of vectors
`grid` should be a rectangular collection of collections. Adds `i` as a border around `grid`. Return a vector of vectors
(bracket coll i)
Add the element i
to the start and end of coll
.
Add the element `i` to the start and end of `coll`.
(bracketv coll i)
Add the element i
to the start and end of coll
and return a vector.
Add the element `i` to the start and end of `coll` and return a vector.
(count-by f coll)
Return a map from the distinct values of f
applied to coll
to the frequencies they occur.
Return a map from the distinct values of `f` applied to `coll` to the frequencies they occur.
(count-when coll)
(count-when coll f)
Count the number of elements in coll
where f
returns true.
If not supplied use identity as f
.
Count the number of elements in `coll` where `f` returns true. If not supplied use identity as `f`.
(map-kv val-fn coll)
(map-kv key-fn val-fn coll)
Construct a new map from an existing one.
Each of val-fn
and key-fn
(optional - default (fn [k _] k))
are
a function of two arguments, the key and value.
Note that to make the usage more natural the optional key-fn
is the first argument when used.
Construct a new map from an existing one. Each of `val-fn` and `key-fn` (optional - default `(fn [k _] k))` are a function of two arguments, the key and value. Note that to make the usage more natural the optional `key-fn` is the first argument when used.
(neighbors cols loc)
loc
is assumed to be a coordinate into a flattened two-dimensional grid with cols
columens.
Gives a vector of coordinates of the horizontal and vertical neighbors. Does not check bounds.
`loc` is assumed to be a coordinate into a flattened two-dimensional grid with `cols` columens. Gives a vector of coordinates of the horizontal and vertical neighbors. Does not check bounds.
(neighbors-with-diagonals cols loc)
loc
is assumed to be a coordinate into a flattened two-dimensional grid with cols
columens.
Gives a vector of the coordinates of horizontal, vertical, and diagonal neighbors.
Does not check bounds.
`loc` is assumed to be a coordinate into a flattened two-dimensional grid with `cols` columens. Gives a vector of the coordinates of horizontal, vertical, and diagonal neighbors. Does not check bounds.
(transpose seqs)
Transpose a rectangular sequence of sequences.
Transpose a rectangular sequence of sequences.
(transposev seqs)
Transpose a rectangular sequence of sequences, returning a vector of vectors.
Transpose a rectangular sequence of sequences, returning a vector of vectors.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close