Liking cljdoc? Tell your friends :D

full.core.sugar


?assocclj/s

(?assoc m & kvs)

Same as clojure.core/assoc, but skip the assoc if v is nil

Same as clojure.core/assoc, but skip the assoc if v is nil
sourceraw docstring

?conjclj/s

(?conj coll & xs)

Same as conj, but skip the conj if v is falsey

Same as conj, but skip the conj if v is falsey
sourceraw docstring

?hash-mapclj/s

(?hash-map & keyvals)

Creates a hash-map from all key value pairs where value is not nil.

Creates a hash-map from all key value pairs where value is not nil.
sourceraw docstring

?move-inclj/s

(?move-in m from to)

Moves a value in nested assoc structure, if it is not nil.

Moves a value in nested assoc structure, if it is not nil.
sourceraw docstring

?updateclj/s

(?update m k f & args)

Performs a clojure.core/update if the original or resulting value is truthy, otherwise dissoc key.

Performs a clojure.core/update if the original or resulting value is truthy,
otherwise dissoc key.
sourceraw docstring

?update-inclj/s

(?update-in m [k & ks] f & args)

Performs a clojure.core/update-in if the original or resulting value is truthy, otherwise dissoc key.

Performs a clojure.core/update-in if the original or resulting value is
truthy, otherwise dissoc key.
sourceraw docstring

all?clj/s

source

as-longclj/s

(as-long s)
source

asciiclj

(ascii s)

Ensures all characters in the given string are converted to ASCII. For example: ā->a.

Ensures all characters in the given string are converted to ASCII.
For example: ā->a.
sourceraw docstring

assoc-firstclj/s

(assoc-first m k)

Replaces value of key k in map m with the first value sequence first item from map given key to resultant map.

Replaces value of key `k` in map `m` with the first value  sequence
first item from map given key to resultant map.
sourceraw docstring

byte-buffer->byte-vectorclj

(byte-buffer->byte-vector bb)
source

byte-buffer->hex-stringclj

(byte-buffer->hex-string byte-buffer)
source

copy-inclj/s

(copy-in m from to)
source

deep-mergeclj/s

(deep-merge & values)

Deep merge two maps

Deep merge two maps
sourceraw docstring

def-nameclj/s

(def-name sym)

Returns human readable name of defined symbol (such as def or defn).

Returns human readable name of defined symbol (such as def or defn).
sourceraw docstring

dissoc-inclj/s

(dissoc-in m [k & ks])
source

dqclj/s

(dq s)

Converts single quotes to double quotes.

Converts single quotes to double quotes.
sourceraw docstring

ellapsed-timeclj/s

(ellapsed-time time-bookmark)

Returns ellapsed time in milliseconds since the time bookmark.

Returns ellapsed time in milliseconds since the time bookmark.
sourceraw docstring

filter-indexedclj/s

(filter-indexed pred coll)
source

fn-namecljmacro

(fn-name meta-name args & body)
source

format-opt-precclj/s

(format-opt-prec n precision)
source

idx-ofclj/s

(idx-of collection item)

Similar to .indexOf, but works with lazy collections as well.

Similar to .indexOf, but works with lazy collections as well.
sourceraw docstring

if->>cljmacro

(if->> cnd & threads)

Using if + ->> inside ->> threads Takes a single condition and one or more forms that will be executed if the condition is true. An else block can be passed in by separating forms with :else keyword. Contition can take the initial value as argument, it needs to be referenced as '%' (eg, (some-condition %) (->> (range 10) (if->> false (filter odd?) (map inc) :else (filter even?) (map dec))) => (-1 1 3 5 7)

Using if + ->> inside ->> threads
Takes a single condition and one or more forms that
will be executed if the condition is true.
An else block can be passed in by separating forms with :else keyword.
 Contition can take the initial value as argument, it needs to be
 referenced as '%' (eg, (some-condition %)
(->> (range 10) (if->> false
                       (filter odd?) (map inc)
                       :else (filter even?) (map dec)))
=> (-1 1 3 5 7)
sourceraw docstring

if-cljscljmacro

(if-cljs then else)

Return then if we are generating cljs code and else for Clojure code. https://groups.google.com/d/msg/clojurescript/iBY5HaQda4A/w1lAQi9_AwsJ

Return then if we are generating cljs code and else for Clojure code.
https://groups.google.com/d/msg/clojurescript/iBY5HaQda4A/w1lAQi9_AwsJ
sourceraw docstring

index-byclj/s

(index-by kf coll)
(index-by kf vf coll)

Returns a map of the values in coll indexed by the result of applying kf. A value mapping function vf can be provided too.

Returns a map of the values in coll indexed by the result of applying kf.
A value mapping function vf can be provided too.
sourceraw docstring

insert-atclj/s

(insert-at s idx i)

Returns the sequence s with the item i inserted at 0-based index idx.

Returns the sequence s with the item i inserted at 0-based index idx.
sourceraw docstring

juxt-partitionclj/s

(juxt-partition pred coll & fns)

Takes a predicate function, a collection and one ore more (fn predicate coll) functions that will be applied to the given collection. Example: (juxt-partition odd? [1 2 3 4] filter remove) => [(1 3) (2 4)].

Takes a predicate function, a collection and one ore more
(fn predicate coll) functions that will be applied to the given collection.
Example: (juxt-partition odd? [1 2 3 4] filter remove) => [(1 3) (2 4)].
sourceraw docstring

map-mapclj/s

(map-map key-fn m)
(map-map key-fn value-fn m)
source

map-valueclj/s

(map-value value-fn m)
source

mapplyclj/s

(mapply f & args)
source

mnameclj/s

(mname obj)

Meta name for the object.

Meta name for the object.
sourceraw docstring

move-inclj/s

(move-in m from to)

Moves a value in nested assoc structure.

Moves a value in nested assoc structure.
sourceraw docstring

move-map-inclj/s

(move-map-in m f from to)
source

nest->cljmacro

(nest-> & threads)

Allows to sneak in ->s inside ->>s. (->> (range 3) (map inc) (nest-> (nth 1) inc) (str "x")) => x3

Allows to sneak in ->s inside ->>s.
(->> (range 3) (map inc) (nest-> (nth 1) inc) (str "x"))
=> x3
sourceraw docstring

num->compactclj/s

(num->compact n & {:keys [prefix suffix]})
source

number-or-stringclj/s

(number-or-string s)
source

pipeclj

(pipe)

Returns a vector containing a sequence that will read from the queue, and a function that inserts items into the queue.

Returns a vector containing a sequence that will read from the
queue, and a function that inserts items into the queue.
sourceraw docstring

query-stringclj/s

(query-string m)
source

re-quoteclj/s

(re-quote s)

Returns a literal regex pattern for given string, similiar to Java's Pattern.quote.

Returns a literal regex pattern for given string, similiar to Java's Pattern.quote.
sourceraw docstring

remapclj/s

(remap m mapping)

Remap keys of m based on mapping.

Remap keys of `m` based on `mapping`.
sourceraw docstring

remove-atclj/s

(remove-at s idx)

Returns the sequence s with the element at 0-based index idx removed.

Returns the sequence s with the element at 0-based index idx removed.
sourceraw docstring

remove-empty-valclj/s

(remove-empty-val m)

Filter empty? values from map.

Filter empty? values from map.
sourceraw docstring

remove-nil-valclj/s

(remove-nil-val m)

Filter nil values from a map m.

Filter nil values from a map m.
sourceraw docstring

remove-prefixclj/s

(remove-prefix s prefix)
source

remove-suffixclj/s

(remove-suffix s suffix)
source

replace-atclj/s

(replace-at s idx i)

Returns the sequence s with the item at 0-based index idx.

Returns the sequence s with the item at 0-based index idx.
sourceraw docstring

replace-prefixclj/s

(replace-prefix s prefix new-prefix)
source

some-whenclj/sdeprecated

(some-when pred coll)

Similiar to some but returns matching value instead of predicates result.

Similiar to some but returns matching value instead of predicates result.
sourceraw docstring

str-greater?clj/s

(str-greater? this that)

Returns true if this is greater than that. Case insensitive.

Returns true if this is greater than that. Case insensitive.
sourceraw docstring

str-smaller?clj/s

(str-smaller? this that)

Returns true if this is smaller than that. Case insensitive.

Returns true if this is smaller than that. Case insensitive.
sourceraw docstring

stripclj/s

(strip s cs)

Takes a string s and a string cs. Removes all cs characters from s.

Takes a string s and a string cs. Removes all cs characters from s.
sourceraw docstring

time-bookmarkclj/s

(time-bookmark)

Returns time bookmark (technically system time in nanoseconds). For use in concert with ellapsed-time to messure execution time of some code block.

Returns time bookmark (technically system time in nanoseconds).
For use in concert with ellapsed-time to messure execution time
of some code block.
sourceraw docstring

update-firstclj/s

(update-first s m)
(update-first s m & args)

Updates first item in sequence s by applying mapping method m to it.

Updates first item in sequence s by applying mapping method m to it.
sourceraw docstring

update-lastclj/s

(update-last s m)
(update-last s m & args)

Updates last item in sequence s by applying mapping method m to it.

Updates last item in sequence s by applying mapping method m to it.
sourceraw docstring

uuidsclj/s

(uuids)

Generates UUID without dashes.

Generates UUID without dashes.
sourceraw docstring

when->cljmacro

(when-> thread cnd & threads)

Using when + -> inside -> threads Takes a single condition and multiple forms that will be executed like a normal -> if the condition is true. Contition can take the initial value as argument, it needs to be referenced as '%' (eg, (some-condition %) (-> "foobar" (upper-case) (when-> true (str "baz"))) => FOOBARbaz

Using when + -> inside -> threads
Takes a single condition and multiple forms that will be executed like a
normal -> if the condition is true.
Contition can take the initial value as argument, it needs to be
referenced as '%' (eg, (some-condition %)
(-> "foobar" (upper-case) (when-> true (str "baz")))
=> FOOBARbaz
sourceraw docstring

when->>cljmacro

(when->> cnd & threads)

Using when + ->> inside ->> threads Takes a single condition and one or more forms that will be executed like a regular ->>, if condition is true. Will pass the initial value if condition is false. Contition can take the initial value as argument, it needs to be referenced as '%' (eg, (some-condition %) (->> (range 10) (map inc) (when->> true (filter even?))) => (2 4 6 8 10)

Using when + ->> inside ->> threads
Takes a single condition and one or more forms that will be executed
like a regular ->>, if condition is true.
Will pass the initial value if condition is false.
Contition can take the initial value as argument, it needs to be
referenced as '%' (eg, (some-condition %)
(->> (range 10) (map inc) (when->> true (filter even?)))
=> (2 4 6 8 10)
sourceraw docstring

when->>->cljmacro

(when->>-> cnd & threads)

Using when + -> inside ->> threads. Takes a single condition cnd and multiple forms that will be exectued as a regular ->>, if the condition is true (otherwise the initial value will be passed to next form). Contition can take the initial value as argument, it needs to be referenced as '%' (eg, (some-condition %) (->> (range 3) (map inc) (when->>-> (seq %) (into ["header"]))) => ("header" 1 2 3)

Using when + -> inside ->> threads.
 Takes a single condition cnd and multiple forms that will be exectued as
 a regular ->>, if the condition is true (otherwise the initial value
 will be passed to next form).
 Contition can take the initial value as argument, it needs to be
 referenced as '%' (eg, (some-condition %)
(->> (range 3) (map inc) (when->>-> (seq %) (into ["header"])))
=> ("header" 1 2 3)
sourceraw docstring

with-mnamecljmacro

(with-mname meta-name body)
source

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

× close