pub enum Obj {
Null,
Vector(Vector),
List(List),
Expr(Expr),
Promise(Option<Box<Obj>>, Expr, Rc<Environment>),
Function(ExprList, Expr, Rc<Environment>),
Environment(Rc<Environment>),
}
Variants§
Null
Vector(Vector)
List(List)
Expr(Expr)
Promise(Option<Box<Obj>>, Expr, Rc<Environment>)
Function(ExprList, Expr, Rc<Environment>)
Environment(Rc<Environment>)
Implementations§
source§impl Obj
impl Obj
pub fn type_of(&self) -> String
pub fn with_visibility(self, visibility: bool) -> EvalResult
pub fn force(self, stack: &mut CallStack) -> EvalResult
pub fn assign(self, value: Obj) -> EvalResult
pub fn as_list(&self) -> EvalResult
pub fn as_integer(self) -> EvalResult
pub fn as_double(self) -> EvalResult
pub fn as_logical(self) -> EvalResult
pub fn as_character(self) -> EvalResult
pub fn as_vector(self) -> EvalResult
pub fn into_usize(&self) -> Result<usize, Signal>
pub fn get(&self, index: usize) -> Option<Obj>
pub fn environment(&self) -> Option<Rc<Environment>>
sourcepub fn try_set_named(&mut self, name: &str, value: Obj) -> EvalResult
pub fn try_set_named(&mut self, name: &str, value: Obj) -> EvalResult
Used for $
-assignment.
sourcepub fn try_get_named_mut(&mut self, name: &str) -> EvalResult
pub fn try_get_named_mut(&mut self, name: &str) -> EvalResult
Used for $
-assignment.
sourcepub fn try_get_named(&mut self, name: &str) -> EvalResult
pub fn try_get_named(&mut self, name: &str) -> EvalResult
Used for $
-access.
pub fn try_get(&self, index: Obj) -> EvalResult
pub fn try_get_inner(&self, index: Obj) -> EvalResult
pub fn try_get_inner_mut(&self, index: Obj) -> EvalResult
pub fn len(&self) -> Option<usize>
pub fn is_empty(&self) -> bool
Trait Implementations§
source§impl Callable for Obj
impl Callable for Obj
fn call(&self, args: ExprList, stack: &mut CallStack) -> EvalResult
fn call_matched( &self, args: List, ellipsis: List, stack: &mut CallStack, ) -> EvalResult
fn match_args( &self, args: List, stack: &mut CallStack, ) -> Result<(List, List), Signal>
fn match_arg_exprs( &self, args: ExprList, stack: &mut CallStack, ) -> Result<(List, List), Signal>
fn call_mut(&self, args: ExprList, stack: &mut CallStack) -> EvalResult
fn call_assign( &self, value: Expr, args: ExprList, stack: &mut CallStack, ) -> EvalResult
source§impl Context for Obj
impl Context for Obj
fn env(&self) -> Rc<Environment>
fn eval_mut(&mut self, expr: Expr) -> EvalResult
fn eval(&mut self, expr: Expr) -> EvalResult
fn get(&mut self, name: String) -> EvalResult
fn get_mut(&mut self, name: String) -> EvalResult
fn get_ellipsis(&mut self) -> EvalResult
fn assign_lazy(&mut self, _to: Expr, _from: Expr) -> EvalResult
fn assign(&mut self, _to: Expr, _from: Obj) -> EvalResult
fn eval_call(&mut self, expr: Expr) -> EvalResult
fn eval_call_mut(&mut self, expr: Expr) -> EvalResult
fn eval_in(&mut self, expr: Expr, env: Rc<Environment>) -> EvalResult
fn eval_and_finalize(&mut self, expr: Expr) -> EvalResult
fn eval_binary(&mut self, exprs: (Expr, Expr)) -> Result<(Obj, Obj), Signal>
fn eval_list_lazy(&mut self, l: ExprList) -> EvalResult
source§impl Format for Obj
impl Format for Obj
fn rfmt_infix(s: &str, args: &ExprList) -> Stringwhere
Self: Sized,
fn rfmt_infix_with(s: &str, _state: FormatState, args: &ExprList) -> Stringwhere
Self: Sized,
fn rfmt(&self) -> String
fn rfmt_with(&self, _state: FormatState) -> String
fn rfmt_call(&self, args: &ExprList) -> String
fn rfmt_call_with(&self, _state: FormatState, _args: &ExprList) -> String
source§impl VecPartialCmp<Obj> for Obj
impl VecPartialCmp<Obj> for Obj
type Output = Result<Obj, Signal>
fn vec_gt(self, rhs: Self) -> Self::Output
fn vec_gte(self, rhs: Self) -> Self::Output
fn vec_lt(self, rhs: Self) -> Self::Output
fn vec_lte(self, rhs: Self) -> Self::Output
fn vec_eq(self, rhs: Self) -> Self::Output
fn vec_neq(self, rhs: Self) -> Self::Output
Auto Trait Implementations§
impl Freeze for Obj
impl !RefUnwindSafe for Obj
impl !Send for Obj
impl !Sync for Obj
impl Unpin for Obj
impl !UnwindSafe for Obj
Blanket Implementations§
source§impl<T> AsDynCompare for Twhere
T: Any + DynCompare,
impl<T> AsDynCompare for Twhere
T: Any + DynCompare,
fn as_any(&self) -> &(dyn Any + 'static)
fn as_dyn_compare(&self) -> &(dyn DynCompare + 'static)
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> DynCompare for T
impl<T> DynCompare for T
fn dyn_eq(&self, other: &(dyn DynCompare + 'static)) -> bool
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more