Liking cljdoc? Tell your friends :D

protobuf.util


as-fnclj

(as-fn x)

Turn an object into a fn if it is not already, by wrapping it in constantly.

Turn an object into a fn if it is not already, by wrapping it in constantly.
sourceraw docstring

catbytesclj

(catbytes & args)
source

combineclj

(combine a b)

Merge two data structures by combining the contents. For maps, merge recursively by adjoining values with the same key. For collections, combine the right and left using into or conj. If the left value is a set and the right value is a map, the right value is assumed to be an existence map where the value determines whether the key is in the merged set. This makes sets unique from other collections because items can be deleted from them.

Merge two data structures by combining the contents. For maps, merge recursively by
adjoining values with the same key. For collections, combine the right and left using
into or conj. If the left value is a set and the right value is a map, the right value
is assumed to be an existence map where the value determines whether the key is in the
merged set. This makes sets unique from other collections because items can be deleted
from them.
sourceraw docstring

Combinercljprotocol

combine-ontoclj

(combine-onto left right)

Merge two data structures by combining the contents. For maps, merge recursively by adjoining values with the same key. For collections, combine the right and left using into or conj. If the left value is a set and the right value is a map, the right value is assumed to be an existence map where the value determines whether the key is in the merged set. This makes sets unique from other collections because items can be deleted from them.

Merge two data structures by combining the contents. For maps, merge recursively by
adjoining values with the same key. For collections, combine the right and left using
into or conj. If the left value is a set and the right value is a map, the right value
is assumed to be an existence map where the value determines whether the key is in the
merged set. This makes sets unique from other collections because items can be deleted
from them.
source

dissoc-fieldsclj

(dissoc-fields schema & fields)

Traverse the given schema, removing the given fields at any level.

Traverse the given schema, removing the given fields at any level.
sourceraw docstring

fixclj

(fix x & clauses)

Walk through clauses, a series of predicate/transform pairs. The first predicate that x satisfies has its transformation clause called on x. Predicates or transforms may be values (eg true or nil) rather than functions; these will be treated as functions that return that value. The last "pair" may be only a transform with no pred: in that case it is unconditionally used to transform x, if nothing previously matched. If no predicate matches, then x is returned unchanged.

Walk through clauses, a series of predicate/transform pairs. The
first predicate that x satisfies has its transformation clause
called on x. Predicates or transforms may be values (eg true or nil)
rather than functions; these will be treated as functions that
return that value.
The last "pair" may be only a transform with no pred: in that case it
is unconditionally used to transform x, if nothing previously matched.
If no predicate matches, then x is returned unchanged.
sourceraw docstring

givenclj/smacro

(given x & clauses)

A macro combining the features of fix and fixing, by using parentheses to group the additional arguments to each clause: (-> x (given string? read-string map? (dissoc :x :y :z) even? (/ 2)))

A macro combining the features of fix and fixing, by using parentheses to group the
additional arguments to each clause:
(-> x
    (given string? read-string
           map? (dissoc :x :y :z)
           even? (/ 2)))
sourceraw docstring

into-setclj

(into-set set map)

Update the given set using an existence map.

Update the given set using an existence map.
sourceraw docstring

map-entryclj/smacro

(map-entry a b)

Create a clojure.lang.MapEntry from a and b. Equivalent to a cons cell. flatland.useful.experimental.unicode contains a shortcut to this, named ·.

Create a clojure.lang.MapEntry from a and b. Equivalent to a cons cell.
flatland.useful.experimental.unicode contains a shortcut to this, named ·.
sourceraw docstring

map-valsclj

(map-vals m f & args)

Create a new map from m by calling function f on each value to get a new value.

Create a new map from m by calling function f on each value to get a new value.
sourceraw docstring

postwalkclj

(postwalk f schema)

Perform a depth-first, post-order traversal of all types within the given schema, replacing each and type with the result of calling f on it.

Perform a depth-first, post-order traversal of all types within the given schema, replacing each
and type with the result of calling f on it.
sourceraw docstring

prewalkclj

(prewalk f schema)

Like postwalk, but do a pre-order traversal.

Like postwalk, but do a pre-order traversal.
sourceraw docstring

to-fixclj

(to-fix & clauses)

A "curried" version of fix, which sets the clauses once, yielding a function that calls fix with the specified first argument.

A "curried" version of fix, which sets the clauses once, yielding a
function that calls fix with the specified first argument.
sourceraw docstring

updateclj

(update m key f & args)

Update a value for the given key in a map where f is a function that takes the previous value and the supplied args and returns the new value. Like update-in*, unchanged values are not re-assoc'd.

Update a value for the given key in a map where f is a function that takes the previous value and
the supplied args and returns the new value. Like update-in*, unchanged values are not
re-assoc'd.
sourceraw docstring

update-in*clj

(update-in* m keys f & args)

Updates a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created. This implementation was adapted from clojure.core, but the behavior is more correct if keys is empty and unchanged values are not re-assoc'd.

Updates a value in a nested associative structure, where ks is a sequence of keys and f is a
function that will take the old value and any supplied args and return the new value, and returns
a new nested structure. If any levels do not exist, hash-maps will be created. This implementation
was adapted from clojure.core, but the behavior is more correct if keys is empty and unchanged
values are not re-assoc'd.
sourceraw docstring

walkclj

(walk inner outer schema)

Traverse all child types of the given schema, calling inner on each, then call outer on the result.

Traverse all child types of the given schema, calling inner on each, then call outer on the result.
sourceraw docstring

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

× close