Class PartialOrdering
<=> PARTIAL?" - unset for some pair of SET values of the type
(isPartial(ISymbol, ISymbol), whyPartial(ISymbol, ISymbol)). Two kinds, and only two:
- a PARTIAL BUILT-IN (
isPartialBuiltIn(ISymbol)): defined only within a group of its own values and unset between groups (a currency forMoney, a unit suffix forDimension); - a developer's type whose values can be of DIFFERENT run-time types under a per-type sameness - an open or
abstract class, record or component, or a trait, with no
<=>written by hand on an abstract base or trait (Sameness.mayMixRuntimeTypes(IAggregateSymbol, ISymbol), the test behind E07187): two values of different run-time types have an unset<=>(D24 rule 3; Steve, 2026-10-27, "extend E07188"). Whether a sub-type exists yet is not asked - as for E07187, a later module can add one.
The built-in kind is DECLARED by the type implementing org.ek9.lang.ComparisonGroup in the runtime; the
compiler reads that declaration, it never lists type names (Steve, 2026-10-21, sameness stock-take 4.4: "the only
partial built-ins are Money and Dimension, declared on the type"). Only that kind gets phase 7's unset case for
<? and >? (isPartialBuiltIn(ISymbol)); the other kind is refused there by E07187.
Every other <=> is TOTAL: it orders every two SET values. A user type's own is judged separately - a
hand-written one by phase5/OrderingTotality (E07188, which asks isPartial(ISymbol, ISymbol) of each <=> it is
built on), a defaulted one by Sameness.orderingSurvives(MethodSymbol, ISymbol), which fails when a field's type is partial.
Never test for Money or Dimension by name or class in the compiler - a new built-in with this
property implements the interface and this class sees it.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanTHE test of whether a<=>of this type can be unset for two SET values of it: a partial built-in, or a type whose values may be of different run-time types under a per-type sameness.static booleanisPartialBuiltIn(ISymbol type) True when the type is a core built-in whose runtime class declares a comparison group.whyPartial(ISymbol type, ISymbol ek9Any) THE wording of why a type's<=>is partial (isPartial(ISymbol, ISymbol)), to follow "'X' ...", or empty when it is total.
-
Method Details
-
isPartialBuiltIn
True when the type is a core built-in whose runtime class declares a comparison group.- Parameters:
type- the type asked about, may be null- Returns:
- true for
MoneyandDimension; false for everything else, user types included
-
isPartial
THE test of whether a<=>of this type can be unset for two SET values of it: a partial built-in, or a type whose values may be of different run-time types under a per-type sameness. A generic's bareTis never judged here (it is judged where it is substituted, or left to the run time).- Parameters:
type- the type asked about, may be nullek9Any- theAnytype- Returns:
- true when its
<=>is partial
-
whyPartial
THE wording of why a type's<=>is partial (isPartial(ISymbol, ISymbol)), to follow "'X' ...", or empty when it is total.- Parameters:
type- the type asked about, may be nullek9Any- theAnytype- Returns:
- the reason, if its
<=>is partial
-