Working with Clojure data representing Convex Lisp code.
Types that cannot be represented directly in Clojure can be created as symbol that look like the related Convex type when printed. Those symbols store the following metadata:
Key | Value |
---|---|
:convex/raw | Value that has been used for creating the symbol |
:convex/type | Convex type |
For instance, (address 42)
produces a symbol #42
with metadata {:convex/raw 42, :convex/type :address}
Working with Clojure data representing Convex Lisp code. Types that cannot be represented directly in Clojure can be created as symbol that look like the related Convex type when printed. Those symbols store the following metadata: | Key | Value | |---|---| | `:convex/raw` | Value that has been used for creating the symbol | | `:convex/type` | Convex type | For instance, `(address 42)` produces a symbol `#42` with metadata `{:convex/raw 42, :convex/type :address}`
(= & arg+)
Substitute for =
so that NaN equals NaN.
Substitute for `=` so that NaN equals NaN.
(address number)
Converts number
into a symbol that ressembles a Convex address.
Converts `number` into a symbol that ressembles a Convex address.
(address? x)
Is x
an address symbol produced by address
?
Is `x` an address symbol produced by [[address]]?
(blob hex-string)
Converts hexstring
into a symbol that ressembles a Convex blob.
Converts `hexstring` into a symbol that ressembles a Convex blob.
(blob? x)
Is x
a blob symbol produced by blob
?
Is `x` a blob symbol produced by [[blob]]?
(call? sym x)
Is x
a form calling sym
?
(call? '-
'(+ 2 3)) ;; False
Is `x` a form calling `sym`? ```clojure (call? '- '(+ 2 3)) ;; False ```
(hex-string? string)
(hex-string? n-byte string)
Is the given string a hex-string?
Is the given string a hex-string?
(list x+)
Turns the given collection into a (list ...)
and stores information in metadata
like typed symbols.
Turns the given collection into a `(list ...)` and stores information in metadata like typed symbols.
(list? x)
Is x
a (list ...)
form produced by list
?
Is `x` a `(list ...)` form produced by [[list]]?
(literal string)
(literal type string)
Produces a symbol from the given string with an optional type (see meta-type
).
A symbol prints exactly as it lookes. Hence, this is useful for templ*
for including expression
that might not be possible to write in Clojure.
(templ* (get ~(literal "{[1] :vec, '(1) :list}")
[1]))
Produces a symbol from the given string with an optional type (see [[meta-type]]). A symbol prints exactly as it lookes. Hence, this is useful for [[templ*]] for including expression that might not be possible to write in Clojure. ```clojure (templ* (get ~(literal "{[1] :vec, '(1) :list}") [1])) ```
(meta-raw x)
Extracts the value stored in :convex/raw
in the metadata of x
.
Extracts the value stored in `:convex/raw` in the metadata of `x`.
(meta-type sym)
Extracts the type keyword stored in :convex/type
in the metadata of x
.
Extracts the type keyword stored in `:convex/type` in the metadata of `x`.
(quoted form)
Quote the given form
as that it will not be evaled when running as Convex Lisp.
Quote the given `form` as that it will not be evaled when running as Convex Lisp.
Regular expression for a hexstring of any (even) length.
Regular expression for a hexstring of any (even) length.
(src form)
Converts a Clojure form expressing Convex Lisp code into a source string.
Converts a Clojure form expressing Convex Lisp code into a source string.
(templ* form)
Macro for templating Convex Lisp Code.
Ressembles Clojure's syntax quote but does not namespace anything.
Unquoting and unquote-splicing for inserting Clojure values are done through the literal notation (respectively
~ and ~@) whereas those same features as Convex are written via forms (respecively (unquote x)
and
(unquote-splicing x)
.
For example:
(let [kw :foo
xs [2 3]
y 42]
(templ* [~kw 1 ~@xs 4 ~y y (unquote y) (unquote-splicing vs)]))
Produces the following vector:
[:foo 1 2 3 4 42 y (unquote y) (unquote-splicing y)]
Macro for templating Convex Lisp Code. Ressembles Clojure's syntax quote but does not namespace anything. Unquoting and unquote-splicing for inserting Clojure values are done through the literal notation (respectively **~** and **~@**) whereas those same features as Convex are written via forms (respecively `(unquote x)` and `(unquote-splicing x)`. For example: ```clojure (let [kw :foo xs [2 3] y 42] (templ* [~kw 1 ~@xs 4 ~y y (unquote y) (unquote-splicing vs)])) ``` Produces the following vector: ```clojure [:foo 1 2 3 4 42 y (unquote y) (unquote-splicing y)] ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close