pub enum Term {
Literal(Datum),
Ref(Ref),
Local(Symbol),
Let {
name: Symbol,
value: Box<Term>,
body: Box<Term>,
},
Op {
op: OpKey,
input: Box<Term>,
},
Call {
target: Box<Term>,
args: Vec<Term>,
},
Seq(Vec<Term>),
Quote {
mode: QuoteMode,
datum: Datum,
},
Annotated {
term: Box<Term>,
annotations: Vec<(Symbol, Datum)>,
},
Extension {
tag: Symbol,
payload: Datum,
},
}Expand description
Lowered executable form.
Current Expr values lower as follows:
- scalar data ->
Term::Literal Expr::Symbol->Term::Ref(Ref::Symbol)Expr::Local->Term::Local- data-only list, vector, map, and set ->
Term::Literal - call ->
Term::Call - infix, prefix, and postfix ->
Term::Callwith a symbolic target - block ->
Term::Seq - quote ->
Term::Quoteover pureDatum - annotated ->
Term::Annotatedwith datum annotations - extension ->
Term::Extensionwith a datum payload
Variants§
Literal(Datum)
A constant datum value.
Ref(Ref)
A reference resolved through the registry or substrate.
Local(Symbol)
A lexical local binding referenced by name.
Let
A local binding form: bind name to value within body.
Fields
Op
An explicit operation invocation over one input term.
Call
A call of target with positional args.
Fields
Seq(Vec<Term>)
A sequence of terms evaluated in order.
Quote
A quoted datum carried at a given quote mode.
Annotated
A term carrying datum-valued annotations.
Fields
Extension
An open extension term with a tag and datum payload.
Implementations§
Trait Implementations§
impl Eq for Term
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnsafeUnpin for Term
impl UnwindSafe for Term
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more