Liking cljdoc? Tell your friends :D

convex.std

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
raw docstring

*clj

(* & xs)

Like classic * but for numeric cells.

Like classic `*` but for numeric cells.
sourceraw docstring

+clj

(+ & xs)

Like classic + but for numeric cells.

Like classic `+` but for numeric cells.
sourceraw docstring

-clj

(- & xs)

Like classic - but for numeric cells.

Like classic `-` but for numeric cells.
sourceraw docstring

<clj

(< & xs)

Like classic < but with numeric cells.

Like classic `<` but with numeric cells.
sourceraw docstring

<=clj

(<= & xs)

Like classic <= but with numeric cells.

Like classic `<=` but with numeric cells.
sourceraw docstring

==clj

(== & xs)

Like classic == but with numeric cells.

Like classic `==` but with numeric cells.
sourceraw docstring

>clj

(> & xs)

Like classic > but with numeric cells.

Like classic `>` but with numeric cells.
sourceraw docstring

>=clj

(>= & xs)

Like classic >= but with numeric cells.

Like classic `>=` but with numeric cells.
sourceraw docstring

absclj

(abs number)

Returns the absolute value of x.

Same type as x.

Returns the absolute value of `x`.

Same type as `x`.
sourceraw docstring

account-keyclj

(account-key cell)

Coerces the given cell to an account key or return nil.

Works with:

  • 64-char hex-string cell
  • 32-byte blob
Coerces the given `cell` to an account key or return nil.

Works with:

- 64-char hex-string cell
- 32-byte blob
sourceraw docstring

addressclj

(address cell)

Coerces the given cell to an address or return nil.

Works with:

  • Long cell
  • 16-char hex-string cell
  • 8-byte blob
Coerces the given `cell` to an address or return nil.

Works with:

- Long cell
- 16-char hex-string cell
- 8-byte blob
sourceraw docstring

address?clj

(address? x)

Is x an address?

Is `x` an address?
sourceraw docstring

assocclj

(assoc coll k v)

Like classic assoc but for collection cells.

Like classic `assoc` but for collection cells.
sourceraw docstring

blobclj

(blob cell)

Coerces the given cell to a blob or return nil.

Works with:

  • Any kind of blob (eg. hash)
  • Long cell
  • Hex-string cell
Coerces the given `cell` to a blob or return nil.

Works with:

- Any kind of blob (eg. hash)
- Long cell
- Hex-string cell
sourceraw docstring

blob-mapclj

(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).
sourceraw docstring

blob-map?clj

(blob-map? x)

Is x a blob map?

Is `x` a blob map?
sourceraw docstring

blob?clj

(blob? x)

Is x a blob?

Is `x` a blob?
sourceraw docstring

boolean?clj

(boolean? x)

Is x a CVM boolean?

Is `x` a CVM boolean?
sourceraw docstring

byteclj

(byte cell)

Coerces the given cell to a byte or return nil.

Coerces the given `cell` to a byte or return nil.
sourceraw docstring

byte?clj

(byte? x)

Is x a byte cell?

Is `x` a byte cell?
sourceraw docstring

ceilclj

(ceil number)

Returns a double cell ceiling the value of number.

Returns a double cell ceiling the value of `number`.
sourceraw docstring

cell?clj

(cell? x)

Is x a cell?

Is `x` a cell?
sourceraw docstring

charclj

(char cell)

Coerces the given cell to a char or return nil.

Coerces the given `cell` to a char or return nil.
sourceraw docstring

char?clj

(char? x)

Is x a char cell?

Is `x` a char cell?
sourceraw docstring

coll?clj

(coll? x)

Is x a collection cell?

Is `x` a collection cell?
sourceraw docstring

concatclj

(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`.
sourceraw docstring

conjclj

(conj)
(conj coll)
(conj coll v)

Akin to classic conj but for collection cells.

Akin to classic `conj` but for collection cells.
sourceraw docstring

consclj

(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.
sourceraw docstring

contains?clj

(contains? coll k)

Like classic contains? but for collection cells.

Like classic `contains?` but for collection cells.
sourceraw docstring

countclj

(count countable)

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
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
sourceraw docstring

cvm-value?clj

(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).
sourceraw docstring

decclj

(dec long)

Like classic dec but for long cells.

Like classic `dec` but for long cells.
sourceraw docstring

differenceclj

(difference set-1 set-2)

Like clojure.set/difference but for set cells.

Like `clojure.set/difference` but for set cells.
sourceraw docstring

dissocclj

(dissoc map k)

Like classic dissoc but for map cells.

Like classic `dissoc` but for map cells.
sourceraw docstring

divclj

(div & xs)

Like classic / but for numeric cells.

Like classic `/` but for numeric cells.
sourceraw docstring

doubleclj

(double cell)

Coerces the given cell to a double or return nil.

Coerces the given `cell` to a double or return nil.
sourceraw docstring

double?clj

(double? x)

Is x a double cell?

Is `x` a double cell?
sourceraw docstring

emptyclj

(empty coll)

Like classic empty but for collection cells.

Like classic `empty` but for collection cells.
sourceraw docstring

empty?clj

(empty? countable)

Is the given countable empty?

See count.

Is the given `countable` empty?

See [[count]].
sourceraw docstring

expclj

(exp number)

Returns e raised to the power of the given numeric cell.

Returns `e` raised to the power of the given numeric cell.
sourceraw docstring

false?clj

(false? x)

Is x a false cell?

Is `x` a `false` cell?
sourceraw docstring

findclj

(find map k)

Like classic `find`` but for map cells.

Like classic `find`` but for map cells.
sourceraw docstring

floorclj

(floor x)

Returns a double cell flooring the value of x.

Returns a double cell flooring the value of `x`.
sourceraw docstring

getclj

(get coll k)
(get coll k not-found)

Like classic get but for collection cells.

Like classic `get` but for collection cells.
sourceraw docstring

hash-mapclj

(hash-map & kvs)

Builds a map from key-values.

Builds a map from key-values.
sourceraw docstring

hash-map?clj

(hash-map? x)

Is x a hash map cell?

Is `x` a hash map cell?
sourceraw docstring

hash-setclj

(hash-set & cell+)

Builds a set from the given cells.

Builds a set from the given cells.
sourceraw docstring

hash-set?clj

(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.
sourceraw docstring

incclj

(inc long)

Like classic inc but for long cells.

Like classic `inc` but for long cells.
sourceraw docstring

intersectionclj

(intersection set-1 set-2)

Like clojure.set/intersection but for set cells.

Like `clojure.set/intersection` but for set cells.
sourceraw docstring

intoclj

(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.
sourceraw docstring

keysclj

(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.
sourceraw docstring

keywordclj

(keyword cell)

Coerces the given cell to a keyword or return nil.

Works with:

  • Max 64-char string cell
  • Symbol
Coerces the given `cell` to a keyword or return nil.

Works with:

- Max 64-char string cell
- Symbol
sourceraw docstring

keyword?clj

(keyword? x)

Is x a keyword cell?

Is `x` a keyword cell?
sourceraw docstring

listclj

(list & cell+)

Buildsa list from the given cells.

Buildsa list from the given cells.
sourceraw docstring

list?clj

(list? x)

Is x a list cell?

Is `x` a list cell?
sourceraw docstring

longclj

(long cell)

Coerces the given cell to a long or return nil.

Coerces the given `cell` to a long or return nil.
sourceraw docstring

long?clj

(long? x)

Is x a long cell?

Is `x` a long cell?
sourceraw docstring

map?clj

(map? x)

Is x a map cell?

Is `x` a map cell?
sourceraw docstring

mergeclj

(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).
sourceraw docstring

modclj

(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.
sourceraw docstring

nameclj

(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.
sourceraw docstring

nan?clj

(nan? cell)

Is the given cell NaN?

Is the given `cell` NaN?
sourceraw docstring

nextclj

(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.
sourceraw docstring

nthclj

(nth countable index)

Like classic nth but for countables.

Index must be a JVM long.

See count.

Like classic `nth` but for countables.

Index must be a JVM long.

See [[count]].
sourceraw docstring

number?clj

(number? x)

Is x a numeric cell?

Either a long or a double.

Is `x` a numeric cell?

Either a long or a double.
sourceraw docstring

powclj

(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`.
sourceraw docstring

reverseclj

(reverse sq)

Like classic reverse but for sequential cells (list or vector cells).

Like classic `reverse` but for sequential cells (list or vector cells).
sourceraw docstring

setclj

(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.
sourceraw docstring

set?clj

(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.
sourceraw docstring

signumclj

(signum number)

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.

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.
sourceraw docstring

sqrtclj

(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.
sourceraw docstring

strclj

(str & cell+)

Stringifies the given cell(s).

Stringifies the given cell(s).
sourceraw docstring

string?clj

(string? x)

Is x a string cell?

Is `x` a string cell?
sourceraw docstring

subset?clj

(subset? set-1 set-2)

Like clojure.set/subset? but for set cells.

Like `clojure.set/subset?` but for set cells.
sourceraw docstring

symbolclj

(symbol cell)

Coerces the given cell to a symbol or return nil.

Works with:

  • Max 64-char string cell
  • Symbol
Coerces the given `cell` to a symbol or return nil.

Works with:

- Max 64-char string cell
- Symbol
sourceraw docstring

symbol?clj

(symbol? x)

Is x a symbol cell?

Is `x` a symbol cell?
sourceraw docstring

syntax?clj

(syntax? x)

Is x a syntax cell?

Is `x` a syntax cell?
sourceraw docstring

true?clj

(true? x)

Is x a true cell?

Is `x` a `true` cell?
sourceraw docstring

unionclj

(union set-1 set-2)

Like clojure.set/union but for set cells.

Like `clojure.set/union` but for set cells.
sourceraw docstring

updateclj

(update coll k f)

Akin to classic update but for collection cell.

Akin to classic `update` but for collection cell.
sourceraw docstring

valsclj

(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.
sourceraw docstring

vecclj

(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]]).
sourceraw docstring

vectorclj

(vector & cell+)

Builds a vector from the given cells.

Builds a vector from the given cells.
sourceraw docstring

vector?clj

(vector? x)

Is x a vector cell?

Is `x` a vector cell?
sourceraw docstring

zero?clj

(zero? x)

Like classic zero? but for cells.

Like classic `zero?` but for cells.
sourceraw docstring

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

× close