Struct cl_interpret::builtin::neg
source · pub struct neg;
Expand description
Negates the ConValue
ⓘ
builtin! fn neg (tail) -> IResult<ConValue>
{
Ok(match tail {
ConValue::Empty => ConValue::Empty,
ConValue::Int(v) => ConValue::Int(-v),
_ => Err(Error::TypeError)?,
})
}
Trait Implementations§
source§impl Callable for neg
impl Callable for neg
source§fn call(&self, env: &mut Environment, args: &[ConValue]) -> IResult<ConValue>
fn call(&self, env: &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 neg
impl RefUnwindSafe for neg
impl Send for neg
impl Sync for neg
impl Unpin for neg
impl UnwindSafe for neg
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