[][src]Enum atomsh::Value

pub enum Value {
    Symbol(String),
    Builtin(Stringfn(_: &Vec<Value>, _: &mut Environment) -> Result<Value, Error>),
    Apply(Box<Self>, Vec<Self>),
    Index(Box<Self>, Box<Self>),
    Run(Box<Self>, Vec<Self>),
    Macro(Vec<String>, Box<Self>),
    Lambda(Vec<String>, Box<Self>, Environment),
    Range(Box<Self>, Box<Self>),
    Define(StringBox<Self>),
    Grouped(Box<Self>),
    Do(Vec<Self>),
    Scope(Vec<Self>),
    And(Box<Self>, Box<Self>),
    Or(Box<Self>, Box<Self>),
    Not(Box<Self>),
    Negate(Box<Self>),
    Add(Box<Self>, Box<Self>),
    Multiply(Box<Self>, Box<Self>),
    Divide(Box<Self>, Box<Self>),
    Subtract(Box<Self>, Box<Self>),
    Remainder(Box<Self>, Box<Self>),
    Greater(Box<Self>, Box<Self>),
    Less(Box<Self>, Box<Self>),
    GreaterEqual(Box<Self>, Box<Self>),
    LessEqual(Box<Self>, Box<Self>),
    Equal(Box<Self>, Box<Self>),
    NotEqual(Box<Self>, Box<Self>),
    Conditional(Box<Self>, Box<Self>, Box<Self>),
    If(Box<Self>, Box<Self>, Box<Self>),
    While(Box<Self>, Box<Self>),
    For(StringBox<Self>, Box<Self>),
    Path(PathBuf),
    Size(Size),
    Boolean(bool),
    String(String),
    Integer(i32),
    Float(f64),
    List(Vec<Self>),
    Table(BTreeMap<String, Self>),
    Nil,
    Error(Box<Error>),
}

Variants

Symbol(String)
Builtin(Stringfn(_: &Vec<Value>, _: &mut Environment) -> Result<Value, Error>)
Apply(Box<Self>, Vec<Self>)
Index(Box<Self>, Box<Self>)
Run(Box<Self>, Vec<Self>)
Macro(Vec<String>, Box<Self>)
Lambda(Vec<String>, Box<Self>, Environment)
Range(Box<Self>, Box<Self>)
Define(StringBox<Self>)
Grouped(Box<Self>)
Do(Vec<Self>)
Scope(Vec<Self>)
And(Box<Self>, Box<Self>)
Or(Box<Self>, Box<Self>)
Not(Box<Self>)
Negate(Box<Self>)
Add(Box<Self>, Box<Self>)
Multiply(Box<Self>, Box<Self>)
Divide(Box<Self>, Box<Self>)
Subtract(Box<Self>, Box<Self>)
Remainder(Box<Self>, Box<Self>)
Greater(Box<Self>, Box<Self>)
Less(Box<Self>, Box<Self>)
GreaterEqual(Box<Self>, Box<Self>)
LessEqual(Box<Self>, Box<Self>)
Equal(Box<Self>, Box<Self>)
NotEqual(Box<Self>, Box<Self>)
Conditional(Box<Self>, Box<Self>, Box<Self>)
If(Box<Self>, Box<Self>, Box<Self>)
While(Box<Self>, Box<Self>)
For(StringBox<Self>, Box<Self>)
Path(PathBuf)
Size(Size)
Boolean(bool)
String(String)
Integer(i32)
Float(f64)
List(Vec<Self>)
Table(BTreeMap<String, Self>)
Nil
Error(Box<Error>)

Implementations

impl Value[src]

pub fn symbol(s: impl ToString) -> Self[src]

pub fn string(s: impl ToString) -> Self[src]

pub fn builtin(
    name: impl ToString,
    body: fn(_: &Vec<Value>, _: &mut Environment) -> Result<Value, Error>
) -> Self
[src]

pub fn eval(&self, env: &mut Environment) -> Result<Value, Error>[src]

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Display for Value[src]

impl PartialEq<Value> for Value[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Colorize for T where
    T: Display
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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