pub enum ArenaError {
Show 13 variants
OutOfMemory,
IndexOutOfBounds,
IndexNotAllocated,
InvalidArgument,
TraceError,
Cyclic,
TypeError,
ParseError,
ArithmeticOverflow,
DivisionByZero,
UnboundVariable,
NotCallable,
ImmutableEnvironment,
}Expand description
Errors that can occur during arena and Lisp operations.
Each variant captures a specific failure mode, enabling precise diagnostics without heap-allocated error messages.
Variants§
OutOfMemory
Arena is full, cannot allocate more cells.
IndexOutOfBounds
Index exceeds the arena’s capacity (>= N).
IndexNotAllocated
Index refers to a slot that has been freed or was never allocated.
InvalidArgument
An argument to an arena operation was invalid (e.g., zero-length contiguous allocation).
TraceError
An error occurred during garbage collection tracing. This can happen if the mark stack overflows or roots are invalid.
Cyclic
Cycle detected during structure traversal (e.g., graph traversal or recursive data structure operations).
TypeError
A value had the wrong type for the requested operation (e.g., expected a Number but found a Cons).
ParseError
A parse error occurred while reading an S-expression.
ArithmeticOverflow
Checked arithmetic overflowed (e.g., addition, negation).
DivisionByZero
Division or modulo by zero.
UnboundVariable
A variable was not found in the current or global environment.
NotCallable
Attempted to call a value that is not a function (lambda or builtin).
ImmutableEnvironment
Attempted to mutate an immutable environment (e.g., the ground environment).
Implementations§
Source§impl ArenaError
impl ArenaError
Sourcepub const fn is_out_of_memory(&self) -> bool
pub const fn is_out_of_memory(&self) -> bool
Check if this error indicates the arena is full.
Sourcepub const fn is_invalid_index(&self) -> bool
pub const fn is_invalid_index(&self) -> bool
Check if this error indicates an invalid index (out of bounds or not allocated).
Sourcepub const fn is_trace_error(&self) -> bool
pub const fn is_trace_error(&self) -> bool
Check if this error is related to garbage collection.
Trait Implementations§
Source§impl Clone for ArenaError
impl Clone for ArenaError
Source§fn clone(&self) -> ArenaError
fn clone(&self) -> ArenaError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more