pub enum Expr {
Var(VarName),
Lam {
param: VarName,
body: Box<Expr>,
},
App {
func: Box<Expr>,
arg: Box<Expr>,
},
Let {
name: VarName,
value: Box<Expr>,
body: Box<Expr>,
},
Fix {
name: VarName,
body: Box<Expr>,
},
Ref {
inner: Box<Expr>,
},
Deref {
inner: Box<Expr>,
},
Assign {
target: Box<Expr>,
value: Box<Expr>,
},
Seq {
first: Box<Expr>,
second: Box<Expr>,
},
}Expand description
The abstract syntax tree.
Variants§
Var(VarName)
Variable reference.
Lam
Lambda abstraction.
App
Function application (left-associative at the surface).
Let
Let-binding.
Fields
Fix
Fixed-point binding: fix name. body.
Fields
Ref
Allocate a fresh cell initialised with the value of inner.
Deref
Dereference the cell pointed to by inner.
Fields
§
inner: Box<Expr>The expression that must evaluate to a Value::Ref.
Assign
Assign value into the cell pointed to by target.
Fields
§
target: Box<Expr>The expression that must evaluate to a Value::Ref.
Seq
Sequence: evaluate first (discarding its value), then evaluate
second and return its value.
Implementations§
Trait Implementations§
impl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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