Enum cl_interpret::convalue::ConValue
source · pub enum ConValue {
Empty,
Int(isize),
Bool(bool),
Char(char),
String(Sym),
Ref(Rc<ConValue>),
Array(Rc<[ConValue]>),
Tuple(Rc<[ConValue]>),
RangeExc(isize, isize),
RangeInc(isize, isize),
Function(Function),
BuiltIn(&'static dyn BuiltIn),
}
Expand description
A Conlang value stores data in the interpreter
Variants§
Empty
The empty/unit ()
type
Int(isize)
An integer
Bool(bool)
A boolean
Char(char)
A unicode character
String(Sym)
A string
Ref(Rc<ConValue>)
A reference
Array(Rc<[ConValue]>)
An Array
Tuple(Rc<[ConValue]>)
A tuple
RangeExc(isize, isize)
An exclusive range
RangeInc(isize, isize)
An inclusive range
Function(Function)
A callable thing
BuiltIn(&'static dyn BuiltIn)
A built-in function
Implementations§
source§impl ConValue
impl ConValue
pub fn range_exc(self, other: Self) -> IResult<Self>
pub fn range_inc(self, other: Self) -> IResult<Self>
pub fn index(&self, index: &Self) -> IResult<ConValue>
sourcepub fn lt(&self, other: &Self) -> IResult<Self>
pub fn lt(&self, other: &Self) -> IResult<Self>
TODO: Remove when functions are implemented: Desugar into function calls
sourcepub fn lt_eq(&self, other: &Self) -> IResult<Self>
pub fn lt_eq(&self, other: &Self) -> IResult<Self>
TODO: Remove when functions are implemented: Desugar into function calls
sourcepub fn eq(&self, other: &Self) -> IResult<Self>
pub fn eq(&self, other: &Self) -> IResult<Self>
TODO: Remove when functions are implemented: Desugar into function calls
sourcepub fn neq(&self, other: &Self) -> IResult<Self>
pub fn neq(&self, other: &Self) -> IResult<Self>
TODO: Remove when functions are implemented: Desugar into function calls
sourcepub fn gt_eq(&self, other: &Self) -> IResult<Self>
pub fn gt_eq(&self, other: &Self) -> IResult<Self>
TODO: Remove when functions are implemented: Desugar into function calls
sourcepub fn gt(&self, other: &Self) -> IResult<Self>
pub fn gt(&self, other: &Self) -> IResult<Self>
TODO: Remove when functions are implemented: Desugar into function calls
pub fn add_assign(&mut self, other: Self) -> IResult<()>
pub fn bitand_assign(&mut self, other: Self) -> IResult<()>
pub fn bitor_assign(&mut self, other: Self) -> IResult<()>
pub fn bitxor_assign(&mut self, other: Self) -> IResult<()>
pub fn div_assign(&mut self, other: Self) -> IResult<()>
pub fn mul_assign(&mut self, other: Self) -> IResult<()>
pub fn rem_assign(&mut self, other: Self) -> IResult<()>
pub fn shl_assign(&mut self, other: Self) -> IResult<()>
pub fn shr_assign(&mut self, other: Self) -> IResult<()>
pub fn sub_assign(&mut self, other: Self) -> IResult<()>
Trait Implementations§
source§impl Callable for ConValue
impl Callable for ConValue
source§fn call(
&self,
interpreter: &mut Environment,
args: &[ConValue]
) -> IResult<ConValue>
fn call( &self, interpreter: &mut Environment, args: &[ConValue] ) -> IResult<ConValue>
Calls this Callable in the provided Environment, with ConValue args
The Callable is responsible for checking the argument count and validating types
The Callable is responsible for checking the argument count and validating types
Auto Trait Implementations§
impl Freeze for ConValue
impl !RefUnwindSafe for ConValue
impl !Send for ConValue
impl !Sync for ConValue
impl Unpin for ConValue
impl !UnwindSafe for ConValue
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