pub enum AtomicClass {
Int,
Float,
Byte,
Char,
Text,
}Expand description
The class of result §7.4’s ten atomics produce — five for ten kinds.
Stated here because it is answered twice, on either side of the
parser-planner/parser-executor boundary. atomic_type turns a class
into the static Type; praxis-runtime’s atomic_descriptor turns the
same class into the runtime TypeDescriptor a collection carries for its
elements. A descriptor that disagrees with the static type behind it is a
defect, and exhaustiveness cannot prevent it: an eleventh atomic forces both
sites to be touched but not to make the same grouping decision. There is
one decision, and the two sides only choose how to spell its answer.
Deliberately its own enum rather than a praxis_typeck::ScalarType:
praxis-runtime does not depend on praxis-typeck (it already depends on
this crate, so there is no cycle), and UInt — the one scalar neither side
may answer — is not nameable here at all. See AtomicClass::of.
Variants§
Implementations§
Source§impl AtomicClass
impl AtomicClass
Sourcepub fn of(kind: AtomicKind) -> AtomicClass
pub fn of(kind: AtomicKind) -> AtomicClass
Classify an atomic by the result it produces (§7.4).
uint is Int, deliberately, in the static type and at runtime alike
(§7.4): ScalarType::UInt is reserved and has no runtime object
(praxis_repr::builtin_for_type answers NoRuntimeRepr), so there is
no descriptor for the runtime side to answer, and typing a uint
capture as UInt would make every program containing one fail to
compile under D9. The non-negativity is the parse rule, in
walk_atomic.
Trait Implementations§
Source§impl Clone for AtomicClass
impl Clone for AtomicClass
Source§fn clone(&self) -> AtomicClass
fn clone(&self) -> AtomicClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more