Liking cljdoc? Tell your friends :D

google-api-clj.playground


headers-and-rows->mapsclj

(headers-and-rows->maps headers rows)

Receives a tabular collection where the first elememt contains the headers and the rest of the elements are the rows. Returns a collection where each row is converted into a map whose keys are the headers. In rows whose number of elements is lower than the number of headers, the missing headers won't appear in the corresponding map. In rows whose number of elements is higher than the number of headers, the additional elements won't appear in the corresponding map.

See also: headers-and-maps->rows.

(headers-and-rows->maps  ["name" "title" "total"]
                         [["David" "Architect" 19]
                          ["Anna" "Dev"]
                          ["Joe" "Analyst" 88 321]])
Receives a tabular collection where the first elememt contains the headers
and the rest of the elements are the rows.
Returns a collection where each row is converted into a map whose keys are the headers.
In rows whose number of elements is lower than the number of headers, the missing headers won't appear in the corresponding map.
In rows whose number of elements is higher than the number of headers, the additional elements won't appear in the corresponding map.

See also: headers-and-maps->rows.

~~~klipse
(headers-and-rows->maps  ["name" "title" "total"]
                         [["David" "Architect" 19]
                          ["Anna" "Dev"]
                          ["Joe" "Analyst" 88 321]])
~~~
sourceraw docstring

map-2d-vecclj

(map-2d-vec f m)

Maps the values of a 2D vector where each element of the vector is a key-value pair. f is a 1-ary function that receives the key.

(map-2d-vec inc [[:a 1] [:b 2]])
Maps the values of a `2D` vector where each element of the vector is a key-value pair.
`f` is a `1-ary` function that receives the key.

~~~klipse
(map-2d-vec inc [[:a 1] [:b 2]])
~~~
sourceraw docstring

map-2d-vec-kvclj

(map-2d-vec-kv fk fv m)

Maps the values of a 2D vector where each element of the vector is a key-value pair. fk is a 1-ary function that receives the key. fv is a 1-ary function that receives the value.

  (map-2d-vec-kv name inc [[:a 1] [:b 2]])
Maps the values of a `2D` vector where each element of the vector is a key-value pair.
`fk` is a `1-ary` function that receives the key.
`fv` is a `1-ary` function that receives the value.

~~~klipse
  (map-2d-vec-kv name inc [[:a 1] [:b 2]])
~~~
sourceraw docstring

map-objectclj

(map-object f m)

Returns a map with the same keys as m and with the values transformed by f. f is a 1-ary function that receives the key.

(map-object inc {:a 1 :b 2 :c 3})
Returns a map with the same keys as `m` and with the values transformed by `f`. `f` is a `1-ary` function that receives the key.

~~~klipse
(map-object inc {:a 1 :b 2 :c 3})
~~~
sourceraw docstring

vec->mapclj

(vec->map vec)

Converts a 2d vec to a hash-map.

 (vec->map [[:a 1] [:b 2]])
Converts a 2d vec to a hash-map.

~~~klipse
 (vec->map [[:a 1] [:b 2]])
~~~
 
sourceraw docstring

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

× close