macro¶
fun macro::block(): blockbuilder
Returns a new block builder.
fun macro::call(): exprbuilder
Returns a new call builder.
fun macro::list(): exprbuilder
Returns a new list builder.
fun macro::map(): exprbuilder
Returns a new list builder.
fun macro::tuple(): exprbuilder
Returns a new list builder.
fun macro::value(Value: any): expr
Returns a new value expression.
type block::builder
Utility object for building a block expression.
meth (Builder: block::builder):do(Exprᵢ: expr, ...): blockbuilder
Adds each expression
Exprᵢ
to a block.meth (Builder: block::builder):end: expr
Finishes a block and returns it as an expression.
meth (Builder: block::builder):let(Name: string, Expr: expr): blockbuilder
Adds a
let
-declaration to a block with initializerExpr
.meth (Builder: block::builder):var(Name: string): blockbuilder
Adds a
var
-declaration to a block.meth (Builder: block::builder):var(Name: string, Expr: expr): blockbuilder
Adds a
var
-declaration to a block with initializerExpr
.type expr
An expression value used by the compiler to implement macros.
fun macro::subst(Expr: expr): macro
Returns a new macro which substitutes its arguments into
Expr
.meth (Expr: expr):scoped(Definitions: map): expr
Returns a new expression which wraps
Expr
with the constant definitions fromDefinitions
.meth (Expr: expr):scoped(Module: module): expr
Returns a new expression which wraps
Expr
with the exports fromModule
.meth (Expr: expr):scoped(Name₁ is Value₁, ...): expr
Returns a new expression which wraps
Expr
with the constant definitions fromNames
andValues
.meth (Expr: expr):scoped(Module: type): expr
Returns a new expression which wraps
Expr
with the exports fromModule
.meth (Expr: expr):subst(Names: list, Subs: list): expr
Returns a new expression which substitutes macro references to
:$Nameᵢ
with the corresponding expressionsSubᵢ
.meth (Expr: expr):subst(Subs: map, ...): expr
Returns a new expression which substitutes macro references to
:$Nameᵢ
with the corresponding expressionSubᵢ
.meth (Expr: expr):subst(Name₁ is Sub₁, ...): expr
Returns a new expression which substitutes macro references to
:$Nameᵢ
with the corresponding expressionSubᵢ
.type expr::builder
Utility object for building a block expression.
meth (Builder: expr::builder):add(Expr: expr, ...): blockbuilder
Adds the expression
Expr
to a block.meth (Builder: expr::builder):end: expr
Finishes a block and returns it as an expression.
type macro
A macro.
fun macro(Function: function): macro
Returns a new macro which applies
Function
when compiled.Function
should have the following signature:Function(Expr₁: expr, Expr₂: expr, ...): expr
.fun macro::fun(Params: map, Arg₂: expr): expr
Returns a new function expression.
fun macro::ident(Name: string): expr
Returns a new identifier expression.