Enum r::object::Obj

source ·
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

source

pub fn type_of(&self) -> String

source

pub fn with_visibility(self, visibility: bool) -> EvalResult

source

pub fn force(self, stack: &mut CallStack) -> EvalResult

source

pub fn assign(self, value: Obj) -> EvalResult

source

pub fn as_list(&self) -> EvalResult

source

pub fn as_integer(self) -> EvalResult

source

pub fn as_double(self) -> EvalResult

source

pub fn as_logical(self) -> EvalResult

source

pub fn as_character(self) -> EvalResult

source

pub fn as_vector(self) -> EvalResult

source

pub fn into_usize(&self) -> Result<usize, Signal>

source

pub fn get(&self, index: usize) -> Option<Obj>

source

pub fn environment(&self) -> Option<Rc<Environment>>

source

pub fn try_set_named(&mut self, name: &str, value: Obj) -> EvalResult

Used for $-assignment.

source

pub fn try_get_named_mut(&mut self, name: &str) -> EvalResult

Used for $-assignment.

source

pub fn try_get_named(&mut self, name: &str) -> EvalResult

Used for $-access.

source

pub fn try_get(&self, index: Obj) -> EvalResult

source

pub fn try_get_inner(&self, index: Obj) -> EvalResult

source

pub fn try_get_inner_mut(&self, index: Obj) -> EvalResult

source

pub fn len(&self) -> Option<usize>

source

pub fn is_empty(&self) -> bool

Trait Implementations§

source§

impl Add for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> EvalResult

Performs the + operation. Read more
source§

impl BitAnd for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl BitOr for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl Callable for Obj

source§

fn call(&self, args: ExprList, stack: &mut CallStack) -> EvalResult

source§

fn call_matched( &self, args: List, ellipsis: List, stack: &mut CallStack, ) -> EvalResult

source§

fn match_args( &self, args: List, stack: &mut CallStack, ) -> Result<(List, List), Signal>

source§

fn match_arg_exprs( &self, args: ExprList, stack: &mut CallStack, ) -> Result<(List, List), Signal>

source§

fn call_mut(&self, args: ExprList, stack: &mut CallStack) -> EvalResult

source§

fn call_assign( &self, value: Expr, args: ExprList, stack: &mut CallStack, ) -> EvalResult

source§

impl CallableFormals for Obj

source§

impl Clone for Obj

source§

fn clone(&self) -> Obj

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Context for Obj

source§

fn env(&self) -> Rc<Environment>

source§

fn eval_mut(&mut self, expr: Expr) -> EvalResult

source§

fn eval(&mut self, expr: Expr) -> EvalResult

source§

fn get(&mut self, name: String) -> EvalResult

source§

fn get_mut(&mut self, name: String) -> EvalResult

source§

fn get_ellipsis(&mut self) -> EvalResult

source§

fn assign_lazy(&mut self, _to: Expr, _from: Expr) -> EvalResult

source§

fn assign(&mut self, _to: Expr, _from: Obj) -> EvalResult

source§

fn eval_call(&mut self, expr: Expr) -> EvalResult

source§

fn eval_call_mut(&mut self, expr: Expr) -> EvalResult

source§

fn eval_in(&mut self, expr: Expr, env: Rc<Environment>) -> EvalResult

source§

fn eval_and_finalize(&mut self, expr: Expr) -> EvalResult

source§

fn eval_binary(&mut self, exprs: (Expr, Expr)) -> Result<(Obj, Obj), Signal>

source§

fn eval_list_lazy(&mut self, l: ExprList) -> EvalResult

source§

impl Debug for Obj

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Obj

source§

fn default() -> Obj

Returns the “default value” for a type. Read more
source§

impl Display for Obj

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
source§

impl Format for Obj

source§

fn rfmt_infix(s: &str, args: &ExprList) -> String
where Self: Sized,

source§

fn rfmt_infix_with(s: &str, _state: FormatState, args: &ExprList) -> String
where Self: Sized,

source§

fn rfmt(&self) -> String

source§

fn rfmt_with(&self, _state: FormatState) -> String

source§

fn rfmt_call(&self, args: &ExprList) -> String

source§

fn rfmt_call_with(&self, _state: FormatState, _args: &ExprList) -> String

source§

impl<T> From<T> for Obj
where Vector: From<T>,

source§

fn from(value: T) -> Self

Converts to this type from the input type.
source§

impl Mul for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
source§

impl Neg for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Not for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl PartialEq for Obj

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Pow<Obj> for Obj

source§

type Output = Result<Obj, Signal>

source§

fn power(self, rhs: Self) -> Self::Output

raise self to the rhs power
source§

impl Rem for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
source§

impl Sub for Obj

source§

type Output = Result<Obj, Signal>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> EvalResult

Performs the - operation. Read more
source§

impl TryFrom<Obj> for Character

source§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Obj) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Obj> for Logical

source§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Obj) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Obj> for Double

source§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Obj) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Obj> for Integer

source§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Obj) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Obj> for Subset

source§

type Error = Signal

The type returned in the event of a conversion error.
source§

fn try_from(value: Obj) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryInto<Rep<Obj>> for Obj

source§

type Error = Signal

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<List, Self::Error>

Performs the conversion.
source§

impl TryInto<Vec<f64>> for Obj

source§

type Error = Signal

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Vec<f64>, Self::Error>

Performs the conversion.
source§

impl TryInto<bool> for Obj

source§

type Error = Signal

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<bool, Self::Error>

Performs the conversion.
source§

impl TryInto<f64> for Obj

source§

type Error = Signal

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<f64, Self::Error>

Performs the conversion.
source§

impl TryInto<i32> for Obj

source§

type Error = Signal

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<i32, Self::Error>

Performs the conversion.
source§

impl VecPartialCmp<Obj> for Obj

source§

type Output = Result<Obj, Signal>

source§

fn vec_gt(self, rhs: Self) -> Self::Output

source§

fn vec_gte(self, rhs: Self) -> Self::Output

source§

fn vec_lt(self, rhs: Self) -> Self::Output

source§

fn vec_lte(self, rhs: Self) -> Self::Output

source§

fn vec_eq(self, rhs: Self) -> Self::Output

source§

fn vec_neq(self, rhs: Self) -> Self::Output

source§

impl ViewMut for Obj

source§

fn view_mut(&self) -> Self

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsDynCompare for T
where T: Any + DynCompare,

source§

fn as_any(&self) -> &(dyn Any + 'static)

source§

fn as_dyn_compare(&self) -> &(dyn DynCompare + 'static)

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynCompare for T
where T: Any + PartialEq,

source§

fn dyn_eq(&self, other: &(dyn DynCompare + 'static)) -> bool

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> SameType<T> for U

source§

fn is_same_type_as(&self, _other: &T) -> bool

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,