Liking cljdoc? Tell your friends :D

hive-gimp.py.lower.core

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

assign-nodeclj

(assign-node target value)
source

attr-nodeclj

(attr-node object attr)
source

binding-assignsclj

(binding-assigns bindings)

A let binding vector as assignments.

A `let` binding vector as assignments.
sourceraw docstring

call-nodeclj

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

desugarclj

(desugar form)

form with a sugared head rewritten; registered heads are never rewritten.

`form` with a sugared head rewritten; registered heads are never rewritten.
sourceraw docstring

expr-formcljmultimethod

A non-empty list form as one Python expression node.

A non-empty list form as one Python expression node.
sourceraw docstring

(head form)

The head symbol of a list form, or nil.

The head symbol of a list form, or nil.
sourceraw docstring

literal-nodeclj

(literal-node v)
source

lower-argsclj

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

lower-exprclj

(lower-expr form)

One Clojure form as a Python expression node.

One Clojure form as a Python expression node.
sourceraw docstring

lower-paramsclj

(lower-params params)

[a b & r] as {:fixed ["a" "b"] :rest "r"}.

`[a b & r]` as `{:fixed ["a" "b"] :rest "r"}`.
sourceraw docstring

lower-stmtsclj

(lower-stmts forms)

Forms as a vector of Python statement nodes.

Forms as a vector of Python statement nodes.
sourceraw docstring

lower-tailclj

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

lower-targetclj

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

lower-tryclj

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

lower-withclj

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

Moduleclj

A vector of statement nodes.

A vector of statement nodes.
sourceraw docstring

name-nodeclj

(name-node id)
source

Nodeclj

Any lowered Python AST node: a map tagged with :py/node.

Any lowered Python AST node: a map tagged with `:py/node`.
sourceraw docstring

Paramsclj

A lowered parameter vector.

A lowered parameter vector.
sourceraw docstring

registered?clj

(registered? sym)

True when sym has its own expr-form registration.

True when `sym` has its own `expr-form` registration.
sourceraw docstring

stmt-formcljmultimethod

A form as a vector of Python statement nodes.

A form as a vector of Python statement nodes.
sourceraw docstring

sugar-rulesclj

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

tail-formcljmultimethod

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

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close