pub enum Value {
Int(i64),
Float(f64),
Bool(bool),
String(SeqString),
Variant(Box<VariantData>),
Map(Box<HashMap<MapKey, Value>>),
Quotation(usize),
Closure {
fn_ptr: usize,
env: Box<[Value]>,
},
}Expand description
Value: What the language talks about
This is pure data with no pointers to other values. Values can be pushed on the stack, stored in variants, etc. The key insight: Value is independent of Stack structure.
Variants§
Int(i64)
Integer value
Float(f64)
Floating-point value (IEEE 754 double precision)
Bool(bool)
Boolean value
String(SeqString)
String (arena or globally allocated via SeqString)
Variant(Box<VariantData>)
Variant (sum type with tagged fields)
Map(Box<HashMap<MapKey, Value>>)
Map (key-value dictionary with O(1) lookup) Keys must be hashable types (Int, String, Bool)
Quotation(usize)
Quotation (stateless function pointer stored as usize for Send safety) No captured environment - backward compatible
Closure
Closure (quotation with captured environment) Contains function pointer and boxed array of captured values
Trait Implementations§
impl Send for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl !Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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