pub enum Expr {
Show 17 variants
Nil,
T,
Number(Ratio<i64>),
String(String),
Symbol(String),
Keyword(String),
Bytes(Vec<u8>),
Cons(Box<Expr>, Box<Expr>),
List(Vec<Expr>),
Quote(Box<Expr>),
Quasiquote(Box<Expr>),
Unquote(Box<Expr>),
UnquoteSplicing(Box<Expr>),
Lambda(LambdaParams, Box<Expr>),
RuntimeValue(Value),
WasmRuntime(WasmType),
WasmLocal(u32, WasmType),
}Variants§
Nil
T
Number(Ratio<i64>)
String(String)
Symbol(String)
Keyword(String)
Bytes(Vec<u8>)
Cons(Box<Expr>, Box<Expr>)
List(Vec<Expr>)
Quote(Box<Expr>)
Quasiquote(Box<Expr>)
Unquote(Box<Expr>)
UnquoteSplicing(Box<Expr>)
Lambda(LambdaParams, Box<Expr>)
RuntimeValue(Value)
WasmRuntime(WasmType)
WasmLocal(u32, WasmType)
Value stored in WASM local variable (index, type)
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn quoted_list(items: Vec<Expr>) -> Self
pub fn quoted_list(items: Vec<Expr>) -> Self
A constant list datum: the empty list is nil, anything else is quoted.
Sourcepub fn is_nil(&self) -> bool
pub fn is_nil(&self) -> bool
The single compile-time truth test: a value is false exactly when it is nil.
pub fn is_atom(&self) -> bool
pub fn as_symbol(&self) -> Option<&str>
Sourcepub fn symbol_parts(&self) -> Option<(Option<&str>, &str)>
pub fn symbol_parts(&self) -> Option<(Option<&str>, &str)>
Splits a Symbol into (namespace, name). A qualified symbol is
stored canonically as NS:NAME (ADR-0029); an unqualified one has no
: and yields (None, name). Non-symbols yield None. The split is
on the single canonical : — NS::NAME was already folded to NS:NAME
by the reader, so at most one : is ever present here.
Trait Implementations§
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