Provides an API for cells with classic convex.core
functions such as conj
.
All clojure.core
functions related to sequences usually understand Convex collections, making them
easy to handle. Some of those (eg. cons
, next
) have counterparts in this namespace in case the return
value must be a cell instead of a Clojure sequence.
Functions take and return cells unless specified otherwise. Predicates return JVM booleans.
Sometimes, it can be useful converting cells to Clojure data, such as unwrapping blob to byte arrays,
which is the purpose of the convex.clj
namespace.
Lastly, in the rare cases where all of this would not be enough, Java interop can be used:
https://www.javadoc.io/doc/world.convex/convex-core/latest/convex/core/data/package-summary.html
Provides an API for cells with classic `convex.core` functions such as [[conj]]. All `clojure.core` functions related to sequences usually understand Convex collections, making them easy to handle. Some of those (eg. `cons`, `next`) have counterparts in this namespace in case the return value must be a cell instead of a Clojure sequence. Functions take and return cells unless specified otherwise. Predicates return JVM booleans. Sometimes, it can be useful converting cells to Clojure data, such as unwrapping blob to byte arrays, which is the purpose of the [[convex.clj]] namespace. Lastly, in the rare cases where all of this would not be enough, Java interop can be used: https://www.javadoc.io/doc/world.convex/convex-core/latest/convex/core/data/package-summary.html
(* & xs)
Like classic *
but for numeric cells.
Like classic `*` but for numeric cells.
(+ & xs)
Like classic +
but for numeric cells.
Like classic `+` but for numeric cells.
(- & xs)
Like classic -
but for numeric cells.
Like classic `-` but for numeric cells.
(< & xs)
Like classic <
but with numeric cells.
Like classic `<` but with numeric cells.
(<= & xs)
Like classic <=
but with numeric cells.
Like classic `<=` but with numeric cells.
(== & xs)
Like classic ==
but with numeric cells.
Like classic `==` but with numeric cells.
(> & xs)
Like classic >
but with numeric cells.
Like classic `>` but with numeric cells.
(>= & xs)
Like classic >=
but with numeric cells.
Like classic `>=` but with numeric cells.
(abs number)
Returns the absolute value of x
.
Same type as x
.
Returns the absolute value of `x`. Same type as `x`.
(account-key cell)
Coerces the given cell
to an account key or return nil.
Works with:
Coerces the given `cell` to an account key or return nil. Works with: - 64-char hex-string cell - 32-byte blob
(address cell)
Coerces the given cell
to an address or return nil.
Works with:
Coerces the given `cell` to an address or return nil. Works with: - Long cell - 16-char hex-string cell - 8-byte blob
(assoc coll k v)
Like classic assoc
but for collection cells.
Like classic `assoc` but for collection cells.
(blob cell)
Coerces the given cell
to a blob or return nil.
Works with:
Coerces the given `cell` to a blob or return nil. Works with: - Any kind of blob (eg. hash) - Long cell - Hex-string cell
(blob-map & kvs)
Builds a blob map from key-values (keys must be blobs).
Builds a blob map from key-values (keys must be blobs).
(byte cell)
Coerces the given cell
to a byte or return nil.
Coerces the given `cell` to a byte or return nil.
(ceil number)
Returns a double cell ceiling the value of number
.
Returns a double cell ceiling the value of `number`.
(char cell)
Coerces the given cell
to a char or return nil.
Coerces the given `cell` to a char or return nil.
(concat x y)
Like classic concat
but for collection cells.
Return type is the same as x
.
Like classic `concat` but for collection cells. Return type is the same as `x`.
(conj)
(conj coll)
(conj coll v)
Akin to classic conj
but for collection cells.
Akin to classic `conj` but for collection cells.
(cons x coll)
Like classic cons
but for collection cells.
Returns a list cell.
Like classic `cons` but for collection cells. Returns a list cell.
(contains? coll k)
Like classic contains?
but for collection cells.
Like classic `contains?` but for collection cells.
(count countable)
Returns a JVM long representing the number of itms in the given cell.
A countable is either:
Returns a JVM long representing the number of itms in the given cell. A countable is either: - Blob - Blob map - Map - List - Set - String - Vector
(cvm-value? x)
Is x
a CVM value?
Returns false if x
is not accessible to the CVM and meant to be used outside (eg. networking).
Is `x` a CVM value? Returns false if `x` is not accessible to the CVM and meant to be used outside (eg. networking).
(dec long)
Like classic dec
but for long cells.
Like classic `dec` but for long cells.
(difference set-1 set-2)
Like clojure.set/difference
but for set cells.
Like `clojure.set/difference` but for set cells.
(dissoc map k)
Like classic dissoc
but for map cells.
Like classic `dissoc` but for map cells.
(div & xs)
Like classic /
but for numeric cells.
Like classic `/` but for numeric cells.
(double cell)
Coerces the given cell
to a double or return nil.
Coerces the given `cell` to a double or return nil.
(empty coll)
Like classic empty
but for collection cells.
Like classic `empty` but for collection cells.
(empty? countable)
Is the given countable
empty?
See count
.
Is the given `countable` empty? See [[count]].
(exp number)
Returns e
raised to the power of the given numeric cell.
Returns `e` raised to the power of the given numeric cell.
(find map k)
Like classic `find`` but for map cells.
Like classic `find`` but for map cells.
(floor x)
Returns a double cell flooring the value of x
.
Returns a double cell flooring the value of `x`.
(get coll k)
(get coll k not-found)
Like classic get
but for collection cells.
Like classic `get` but for collection cells.
(hash-map & kvs)
Builds a map from key-values.
Builds a map from key-values.
(hash-set & cell+)
Builds a set from the given cells.
Builds a set from the given cells.
(hash-set? x)
Is x
a hash set cell?
Currently at least, hast sets are the only kind of available sets.
Is `x` a hash set cell? Currently at least, hast sets are the only kind of available sets.
(inc long)
Like classic inc
but for long cells.
Like classic `inc` but for long cells.
(intersection set-1 set-2)
Like clojure.set/intersection
but for set cells.
Like `clojure.set/intersection` but for set cells.
(into to from)
(into to xform from)
Like classic into
but to
is a collection cell.
Like classic `into` but `to` is a collection cell.
(keys map)
Like classic keys
but for map cells.
Returns an eager vector cell.
Like classic `keys` but for map cells. Returns an eager vector cell.
(keyword cell)
Coerces the given cell
to a keyword or return nil.
Works with:
Coerces the given `cell` to a keyword or return nil. Works with: - Max 64-char string cell - Symbol
(list & cell+)
Buildsa list from the given cells.
Buildsa list from the given cells.
(long cell)
Coerces the given cell
to a long or return nil.
Coerces the given `cell` to a long or return nil.
(merge map-1 map-2)
Like classic merge
but for hash map cells (not blob maps).
Like classic `merge` but for hash map cells (not blob maps).
(mod a b)
Returns the integer modulus of a numerator divided by a divisor.
Result will always be positive and consistent with Euclidean Divsion.
Returns the integer modulus of a numerator divided by a divisor. Result will always be positive and consistent with Euclidean Divsion.
(name symbolic)
Like classic name
but for keyword and symbol cells.
Returns a string cell.
Like classic `name` but for keyword and symbol cells. Returns a string cell.
(next coll)
Like classic next
but for collection cells.
Return type is a list cell if coll
is a list, a vector cell otherwise.
Like classic `next` but for collection cells. Return type is a list cell if `coll` is a list, a vector cell otherwise.
(nth countable index)
Like classic `nth` but for countables. Index must be a JVM long. See [[count]].
(number? x)
Is x
a numeric cell?
Either a long or a double.
Is `x` a numeric cell? Either a long or a double.
(pow x y)
Returns a CVM double, x
raised to the power of y
.
Returns a CVM double, `x` raised to the power of `y`.
(reverse sq)
Like classic reverse
but for sequential cells (list or vector cells).
Like classic `reverse` but for sequential cells (list or vector cells).
(set cell)
Coerces the given cell
to a set or return nil.
Works with any collection.
Coerces the given `cell` to a set or return nil. Works with any collection.
(set? x)
Is x
a set cell?
Currently at least, hast sets are the only kind of available sets.
Is `x` a set cell? Currently at least, hast sets are the only kind of available sets.
(signum number)
Returns the sign of the number:
-1
if negative0
if 01
if positiveAs a long cell if input is a long, double cell if it is a double.
Returns the sign of the number: - `-1` if negative - `0` if 0 - `1` if positive As a long cell if input is a long, double cell if it is a double.
(sqrt number)
Returns a double cell, the square root of the given number
cell.
Returns a double cell, the square root of the given `number` cell.
(str & cell+)
Stringifies the given cell(s).
Stringifies the given cell(s).
(subset? set-1 set-2)
Like clojure.set/subset?
but for set cells.
Like `clojure.set/subset?` but for set cells.
(symbol cell)
Coerces the given cell
to a symbol or return nil.
Works with:
Coerces the given `cell` to a symbol or return nil. Works with: - Max 64-char string cell - Symbol
(union set-1 set-2)
Like clojure.set/union
but for set cells.
Like `clojure.set/union` but for set cells.
(update coll k f)
Akin to classic update
but for collection cell.
Akin to classic `update` but for collection cell.
(vals map)
Like classic vals
but for map cells.
Returns an eager vector cell.
Like classic `vals` but for map cells. Returns an eager vector cell.
(vec cell)
Coerces the given cell
to a vector or return nil.
Works with any countable (see count
).
Coerces the given `cell` to a vector or return nil. Works with any countable (see [[count]]).
(vector & cell+)
Builds a vector from the given cells.
Builds a vector from the given cells.
(zero? x)
Like classic zero?
but for cells.
Like classic `zero?` but for cells.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close