Struct Cond

Source
pub struct Cond;
Expand description

TyLisp operator for complex conditionals

Takes any number of arguments of the form {Condition, Consequent} Evaluates to the Consequent corresponding to the first True condition.

The expression is invalid if any Condition preceeding the selected one evaluates to anything other than False or if the selected Consequent is invalid.

If all conditions evaluate to False, the expression is valid but evaluates to a private type.

Trait Implementations§

Source§

impl<Q> Calc<Q> for Cond
where Self: Default,

Source§

type Result = Cond

Source§

fn calc(_: Q) -> Self

Source§

impl Call for Cond

Source§

type Conv = Syntax

Which calling convention is expected? Read more
Source§

impl Debug for Cond

Source§

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

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

impl Default for Cond

Source§

fn default() -> Cond

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

impl Eval for Cond

Source§

impl LispId for Cond

Source§

impl<Test, Res, Else, QTest, QRes, QElse> SynCalc<HCons<HCons<Test, HCons<Res, HNil>>, Else>, HCons<HCons<QTest, HCons<QRes, HNil>>, QElse>> for Cond
where HCons<If, HCons<Test, HCons<Res, HCons<HCons<Cond, Else>, HNil>>>>: Calc<HCons<If, HCons<QTest, HCons<QRes, HCons<HCons<Cond, QElse>, HNil>>>>>,

Source§

type Result = <HCons<If, HCons<Test, HCons<Res, HCons<HCons<Cond, Else>, HNil>>>> as Calc<HCons<If, HCons<QTest, HCons<QRes, HCons<HCons<Cond, QElse>, HNil>>>>>>::Result

Source§

fn syn_calc( self, _: HCons<HCons<QTest, HCons<QRes, HNil>>, QElse>, ) -> Self::Result

Source§

impl<Test, Res, Else> SynCall<HCons<HCons<Test, HCons<Res, HNil>>, Else>> for Cond
where HCons<If, HCons<Test, HCons<Res, HCons<HCons<Cond, Else>, HNil>>>>: Eval,

Source§

type Result = <HCons<If, HCons<Test, HCons<Res, HCons<HCons<Cond, Else>, HNil>>>> as Eval>::Result

Source§

impl SynCall<HNil> for Cond
where HCons<Ret, HCons<CondNoMatch, HNil>>: Eval,

Source§

type Result = <HCons<Ret, HCons<CondNoMatch, HNil>> as Eval>::Result

Auto Trait Implementations§

§

impl Freeze for Cond

§

impl RefUnwindSafe for Cond

§

impl Send for Cond

§

impl Sync for Cond

§

impl Unpin for Cond

§

impl UnwindSafe for Cond

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> 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> 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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

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