> (leftValue rightValue -- isGreater)
Inputs
leftValue: Left operand in the comparison.rightValue: Right operand in the comparison.
Outputs
isGreater:Condresult that isTRUEwhenleftValueis greater thanrightValue, and unknown when ordering cannot be decided at compile time.
> tests whether the left dereferenced object is greater than the right dereferenced object.
Supported inputs are objects whose dereferenced schemas are same-schema numeric or Text. Both inputs must be non-NIL. Text inputs must also be known.
Behavior
- If the dereferenced schemas differ, the builtin is invalid. It does not return
FALSE. - If both numeric objects have known values, the result is known at compile time.
- If one or both numeric objects have unknown values, the result is an unknown
Cond, except for the boundary cases below. - For Whole schemas only, two boundary cases still become known
FALSEwith one unknown operand: a known right maximum, and a known left minimum. - Known Text objects compare lexicographically by their UTF-8 contents.
- Unknown Text objects are invalid.
- A known
NILText input is invalid.
Example: > on numbers and Text
> compares numbers and known Text, dereferencing references first, and an unknown Int32 operand gives an unknown Cond unless the known operand is the largest Int32 value on the right or the smallest on the left, which gives FALSE.
{} 0 {} [
first: 5;
second: 4;
intValue: 0 dynamic;
"-- int32 --" printCompilerMessage
5 4 > printStack _:;
4 4 > printStack _:;
3 4 > printStack _:;
"-- references are dereferenced first --" printCompilerMessage
@first @second > printStack _:;
@second @first > printStack _:;
"-- unknown int32 --" printCompilerMessage
intValue 5 > printStack _:;
"-- Whole boundary case --" printCompilerMessage
intValue 2147483647 > printStack _:;
"-- text --" printCompilerMessage
"beta" "alpha" > printStack _:;
"alpha" "beta" > printStack _:;
0
] "main" exportFunction
Expected Output During Compilation
-- int32 --
TRUE
FALSE
FALSE
-- references are dereferenced first --
TRUE
FALSE
-- unknown int32 --
Cond
-- Whole boundary case --
FALSE
-- text --
TRUE
FALSE
See also
<builtin(leftValue rightValue -- isLess)Tests whether the left dereferenced object is less than the right one for supported same-schema numeric or known Text objects.=builtin(leftValue rightValue -- isEqual)Tests equality of values after dereferencing for Cond, numeric, and Text objects of the same schema.isbuiltin(leftValue rightValue -- isIdentityLike)Tests identity-like equality for references, Text, and Code objects of the same dereferenced schema; In-place objects of the same schema still giveFALSE.samebuiltin(leftSchema rightSchema -- isSameSchema)Tests whether two dereferenced schemas are exactly the same; this is schema equality only, not runtime-value equality.