Liking cljdoc? Tell your friends :D

convex.clj

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:

KeyValue
:convex/rawValue that has been used for creating the symbol
:convex/typeConvex 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}`
raw docstring

=clj

(= & arg+)

Substitute for = so that NaN equals NaN.

Substitute for `=` so that NaN equals NaN.
sourceraw docstring

addressclj

(address number)

Converts number into a symbol that ressembles a Convex address.

Converts `number` into a symbol that ressembles a Convex address.
sourceraw docstring

address?clj

(address? x)

Is x an address symbol produced by address?

Is `x` an address symbol produced by [[address]]?
sourceraw docstring

blobclj

(blob hex-string)

Converts hexstring into a symbol that ressembles a Convex blob.

Converts `hexstring` into a symbol that ressembles a Convex blob.
sourceraw docstring

blob?clj

(blob? x)

Is x a blob symbol produced by blob?

Is `x` a blob symbol produced by [[blob]]?
sourceraw docstring

call?clj

(call? sym x)

Is x a form calling sym?

(call? '-
       '(+ 2 3))  ;; False
Is `x` a form calling `sym`?

```clojure
(call? '-
       '(+ 2 3))  ;; False
```
sourceraw docstring

hex-string?clj

(hex-string? string)
(hex-string? n-byte string)

Is the given string a hex-string?

Is the given string a hex-string?
sourceraw docstring

listclj

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

list?clj

(list? x)

Is x a (list ...) form produced by list?

Is `x` a `(list ...)` form produced by [[list]]?
sourceraw docstring

literalclj

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

meta-rawclj

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

meta-typeclj

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

meta-type?clj

(meta-type? type x)
sourceraw docstring

quotedclj

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

quoted?clj

(quoted? x)

Is x a (quote ...) form?

Is `x` a `(quote ...)` form?
sourceraw docstring

regex-hex-stringclj

Regular expression for a hexstring of any (even) length.

Regular expression for a hexstring of any (even) length.
sourceraw docstring

srcclj

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

templ*cljmacro

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

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

× close