Liking cljdoc? Tell your friends :D

common-clj.misc


camelcase->dashclj

(camelcase->dash m)
source

dash->underscoreclj

(dash->underscore m)

Inverse of underscore->dash Example: => (dash->underscore {:foo-bar {:bar-foo 1}}) {:foo_bar {:bar_foo 1}}

Inverse of underscore->dash
Example:
  => (dash->underscore {:foo-bar {:bar-foo 1}})
  {:foo_bar {:bar_foo 1}}
sourceraw docstring

for-mapcljmacro

(for-map seq-exprs key-expr val-expr)
(for-map m-sym seq-exprs key-expr val-expr)

Like 'for' for building maps. Same bindings except the body should have a key-expression and value-expression. If a key is repeated, the last value (according to "for" semantics) will be retained. (= (for-map [i (range 2) j (range 2)] [i j] (even? (+ i j))) {[0 0] true, [0 1] false, [1 0] false, [1 1] true}) An optional symbol can be passed as a first argument, which will be bound to the transient map containing the entries produced so far.

Like 'for' for building maps. Same bindings except the body should have a
key-expression and value-expression. If a key is repeated, the last
value (according to "for" semantics) will be retained.
(= (for-map [i (range 2) j (range 2)] [i j] (even? (+ i j)))
   {[0 0] true, [0 1] false, [1 0] false, [1 1] true})
An optional symbol can be passed as a first argument, which will be
bound to the transient map containing the entries produced so far.
sourceraw docstring

map-keysclj

(map-keys f m)

Build map k -> (f v) for [k v] in map, preserving the initial type

Build map k -> (f v) for [k v] in map, preserving the initial type
sourceraw docstring

map-valsclj

(map-vals f m)

Build map k -> (f v) for [k v] in map, preserving the initial type

Build map k -> (f v) for [k v] in map, preserving the initial type
sourceraw docstring

map-vals-with-keyclj

(map-vals-with-key f m)

Build map k -> (f v) for [k v] in map, preserving the initial type

Build map k -> (f v) for [k v] in map, preserving the initial type
sourceraw docstring

replace-charclj

(replace-char s from to exceptions)

Inputs: [s :- string-or-keyword from :- Character to :- Character exceptions :- #{s/Keyword}] Returns: s/Keyword

Inputs: [s :- string-or-keyword from :- Character to :- Character exceptions :- #{s/Keyword}]
Returns: s/Keyword
sourceraw docstring

replace-char-genclj

(replace-char-gen from to)
(replace-char-gen from to exceptions)

Inputs: ([from :- Character to :- Character] [from :- Character to :- Character exceptions :- #{s/Keyword}]) Returns: (s/pred fn?)

Inputs: ([from :- Character to :- Character] [from :- Character to :- Character exceptions :- #{s/Keyword}])
Returns: (s/pred fn?)
sourceraw docstring

string-or-keywordclj

source

underscore->dashclj

(underscore->dash m)

Convert hash-map underscored keywords to dash. Example: => (underscore->dash {:foo_bar {:bar_foo 1}}) {:foo-bar {:bar-foo 1}}

Convert hash-map underscored keywords to dash.
Example:
  => (underscore->dash {:foo_bar {:bar_foo 1}})
  {:foo-bar {:bar-foo 1}}
sourceraw docstring

vectorizeclj

(vectorize x)

Recursively transforms all seq in m to vectors. Because maybe you want to use core.match with it.

Recursively transforms all seq in m to vectors.
Because maybe you want to use core.match with it.
sourceraw docstring

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

× close