Api providing generic compilation utilities.
Api providing generic compilation utilities.
Map containing the default functions of a compiler implementation.
It has 4 keys:
:name
: the name of the implementation (a keyword):default-emit-str!
: function that compiles plain text. The escaping logic is intended to live here.:default-emit-tag!
: function that compiles a regular tag.:default-emit-special!
: function that compiles a special tagBy default this var provides functions that throw exceptions forcing specific implementations to define them.
Map containing the default functions of a compiler implementation. It has 4 keys: - `:name`: the name of the implementation (a keyword) - `:default-emit-str!`: function that compiles plain text. The escaping logic is intended to live here. - `:default-emit-tag!`: function that compiles a regular tag. - `:default-emit-special!`: function that compiles a special tag By default this var provides functions that throw exceptions forcing specific implementations to define them.
(bind-output out & body)
Bind *compilation-out*
to out
and execute body
in this environment.
Bind [[*compilation-out*]] to `out` and execute `body` in this environment.
(emit! & args)
Emit text to *compilation-out*
.
args
are emitted in sequence, nil values are discarded.
Emit text to [[*compilation-out*]]. `args` are emitted in sequence, nil values are discarded.
(emit-doc! node)
Emit a document to *compilation-out*
.
The *implementation*
also needs to be bound.
Emit a document to [[*compilation-out*]]. The [[*implementation*]] also needs to be bound.
(emit-seq! ss)
Generic emit-special! function using the specific implementation from *implementation*
by default.
This function dispatches on a pair of value constructed like this:
[(:name *implementation*) (:type node)]
, node
being a map, the only argument of the function.
Generic emit-special! function using the specific implementation from [[*implementation*]] by default. This function dispatches on a pair of value constructed like this: `[(:name *implementation*) (:type node)]`, `node` being a map, the only argument of the function.
(emit-str! s)
Generic emit! function using the specific implementation from *implementation*
.
Generic emit! function using the specific implementation from [[*implementation*]].
Generic emit-tag! function using the specific implementation from *implementation*
by default.
This function dispatches on a pair of value constructed like this:
[(:name *implementation*) (:tag node)]
, node
being a map, the only argument of the function.
Generic emit-tag! function using the specific implementation from [[*implementation*]] by default. This function dispatches on a pair of value constructed like this: `[(:name *implementation*) (:tag node)]`, `node` being a map, the only argument of the function.
(append! this text)
(text-environment & body)
Binds *compilation-out*
to a stringbuilder using text-output
Binds [[*compilation-out*]] to a stringbuilder using [[text-output]]
(text-output)
Create a text output intended to be a possible binding for *compilation-out*
using
a java java.lang.StringBuilder
.
Create a text output intended to be a possible binding for [[*compilation-out*]] using a java `java.lang.StringBuilder`.
Create a text output intended to be a possible binding for *compilation-out*
using
a goog.string StringBuffer
.
Create a text output intended to be a possible binding for [[*compilation-out*]] using a `goog.string StringBuffer`.
(with-implementation i & body)
Binds the dynamic var *implementation*
to i
.
See *implementation*
for specifics.
Binds the dynamic var [[*implementation*]] to `i`. See [[*implementation*]] for specifics.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close