The Python AST as data: the DOMAIN value of hive-gimp.py.
Every node is a map carrying :py/node. Lowering (hive-gimp.py.lower)
produces these, rendering (hive-gimp.py.render) consumes them, and nothing
in between speaks Python text. The node shapes are the contract in
docs/py-strata.md; this namespace is where that contract is checkable.
REGISTERED, NOT PRIVATE
Every schema is registered in the hive schema registry (hive-schemas, over
hive-spi) at load time, under :hive-gimp.py/* for the aggregates and
:hive-gimp.py.expr/<node> / :hive-gimp.py.stmt/<node> per node. Any
namespace, test or tool can then validate or GENERATE an AST by key, and
the generators are what the trifecta properties run on.
OPEN BY REGISTRATION
The node vocabulary is two maps, expr-nodes and stmt-nodes, keyed by the
:py/node value. A new node is a new entry, never an edit to a dispatch:
Expr and Stmt are :multi schemas built from those maps. Every node map
is CLOSED and pins its own :py/node, so a misspelt key is a validation
error rather than a silently ignored field. A key documented as -or-nil
may be absent or nil.
Pure apart from the idempotent registration: no Python, no rendering.
The Python AST as data: the DOMAIN value of `hive-gimp.py`. Every node is a map carrying `:py/node`. Lowering (`hive-gimp.py.lower`) produces these, rendering (`hive-gimp.py.render`) consumes them, and nothing in between speaks Python text. The node shapes are the contract in `docs/py-strata.md`; this namespace is where that contract is checkable. REGISTERED, NOT PRIVATE Every schema is registered in the hive schema registry (hive-schemas, over hive-spi) at load time, under `:hive-gimp.py/*` for the aggregates and `:hive-gimp.py.expr/<node>` / `:hive-gimp.py.stmt/<node>` per node. Any namespace, test or tool can then validate or GENERATE an AST by key, and the generators are what the trifecta properties run on. OPEN BY REGISTRATION The node vocabulary is two maps, `expr-nodes` and `stmt-nodes`, keyed by the `:py/node` value. A new node is a new entry, never an edit to a dispatch: `Expr` and `Stmt` are `:multi` schemas built from those maps. Every node map is CLOSED and pins its own `:py/node`, so a misspelt key is a validation error rather than a silently ignored field. A key documented as `-or-nil` may be absent or nil. Pure apart from the idempotent registration: no Python, no rendering.
The Python spellings a :binop may carry. Register an operator here.
The Python spellings a `:binop` may carry. Register an operator here.
(explain x)(explain schema x)nil when x conforms, else the humanized malli explanation.
nil when `x` conforms, else the humanized malli explanation.
Expression node schemas by :py/node. Register a node by adding an entry.
Expression node schemas by `:py/node`. Register a node by adding an entry.
A Clojure value render can spell.
A Clojure value render can spell.
Every schema this namespace contributes, by registry key.
Every schema this namespace contributes, by registry key.
Statement node schemas by :py/node. Register a node by adding an entry.
Statement node schemas by `:py/node`. Register a node by adding an entry.
The Python spellings a :unop may carry. Register an operator here.
The Python spellings a `:unop` may carry. Register an operator here.
(valid? x)(valid? schema x)True when x conforms to schema (Expr, Stmt, Target, Params, Module, or
a registry key). With one argument the schema is inferred: vector Module,
statement node Stmt, otherwise Expr.
True when `x` conforms to `schema` (Expr, Stmt, Target, Params, Module, or a registry key). With one argument the schema is inferred: vector Module, statement node Stmt, otherwise Expr.
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 |