pub struct OpDef {
pub readings: [Result<Verb, String>; 4],
}Expand description
An operator dfn’s body, parsed once for each reading of its operands.
Whether ⍺⍺ names a function or an array decides how the body PARSES,
not merely what it computes: ⍺⍺+⍵ is a train under the first reading
and a sum under the second. The body is therefore parsed both ways —
four ways when it takes a right operand as well — when the dfn is
defined, and the operands choose the reading when they arrive.
Fields§
§readings: [Result<Verb, String>; 4]Indexed by (⍺⍺ is an array) + 2 × (⍵⍵ is an array). Err holds
what the body said when it would not parse that way, so choosing
that reading reports the body’s own complaint.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OpDef
impl !UnwindSafe for OpDef
impl Freeze for OpDef
impl Send for OpDef
impl Sync for OpDef
impl Unpin for OpDef
impl UnsafeUnpin for OpDef
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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