The lowering kernel: Clojure forms to Python AST maps (see docs/py-strata.md).
Three open registries, each a multimethod on the head symbol of a list form:
expr-form (an expression node), stmt-form (a vector of statement nodes)
and tail-form (a vector of statement nodes ending in a return). Adding a
form is a defmethod; this namespace only holds the defaults, the sugar
rules and the node builders the registrations share.
The lowering kernel: Clojure forms to Python AST maps (see docs/py-strata.md). Three open registries, each a multimethod on the head symbol of a list form: `expr-form` (an expression node), `stmt-form` (a vector of statement nodes) and `tail-form` (a vector of statement nodes ending in a return). Adding a form is a `defmethod`; this namespace only holds the defaults, the sugar rules and the node builders the registrations share.
(binding-assigns bindings)A let binding vector as assignments.
A `let` binding vector as assignments.
(call-node f args)A call of the node f with Clojure argument forms args.
A call of the node `f` with Clojure argument forms `args`.
(desugar form)form with a sugared head rewritten; registered heads are never rewritten.
`form` with a sugared head rewritten; registered heads are never rewritten.
A non-empty list form as one Python expression node.
A non-empty list form as one Python expression node.
(head form)The head symbol of a list form, or nil.
The head symbol of a list form, or nil.
(lower-args args)Positional arguments, then each :k v pair as a keyword argument:
{:args [E] :kwargs [["k" E]]}.
Positional arguments, then each `:k v` pair as a keyword argument:
`{:args [E] :kwargs [["k" E]]}`.(lower-expr form)One Clojure form as a Python expression node.
One Clojure form as a Python expression node.
(lower-params params)[a b & r] as {:fixed ["a" "b"] :rest "r"}.
`[a b & r]` as `{:fixed ["a" "b"] :rest "r"}`.
(lower-stmts forms)Forms as a vector of Python statement nodes.
Forms as a vector of Python statement nodes.
(lower-tail body)A function body as statements, its last form's value returned.
A function body as statements, its last form's value returned.
(lower-target t)A binding target: a symbol is a name, a vector a destructuring tuple.
A binding target: a symbol is a name, a vector a destructuring tuple.
(lower-try clauses lower-body)A try body with (catch T e ...) and (finally ...) clauses; the body
and the handlers lower through lower-body, the finally block as statements.
A `try` body with `(catch T e ...)` and `(finally ...)` clauses; the body and the handlers lower through `lower-body`, the finally block as statements.
(lower-with registry form)(registry form), a malformed form's host exception turned into the
unsupported-form refusal; refusals raised inside pass through unchanged.
`(registry form)`, a malformed form's host exception turned into the unsupported-form refusal; refusals raised inside pass through unchanged.
Any lowered Python AST node: a map tagged with :py/node.
Any lowered Python AST node: a map tagged with `:py/node`.
(registered? sym)True when sym has its own expr-form registration.
True when `sym` has its own `expr-form` registration.
A form as a vector of Python statement nodes.
A form as a vector of Python statement nodes.
Head spellings rewritten to a registered head. Ordered: the first rule whose
:match? accepts the head's name rewrites [head name args].
Head spellings rewritten to a registered head. Ordered: the first rule whose `:match?` accepts the head's name rewrites `[head name args]`.
The last form of a function body as a vector of statement nodes that returns its value.
The last form of a function body as a vector of statement nodes that returns its value.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |