< (leftValue rightValue -- isLess)

Inputs

Outputs

< tests whether the left dereferenced object is less 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

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 left or the smallest on the right, which gives FALSE.

{} 0 {} [
  first: 3;
  second: 4;
  intValue: 0 dynamic;

  "-- int32 --" printCompilerMessage
  3 4 < printStack _:;
  4 4 < printStack _:;
  5 4 < printStack _:;

  "-- references are dereferenced first --" printCompilerMessage
  @first @second < printStack _:;
  @second @first < printStack _:;

  "-- unknown int32 --" printCompilerMessage
  intValue 5 < printStack _:;

  "-- Whole boundary cases --" printCompilerMessage
  2147483647 intValue < printStack _:;
  intValue -2147483648 < printStack _:;

  "-- text --" printCompilerMessage
  "alpha" "beta" < printStack _:;
  "beta" "alpha" < printStack _:;

  0
] "main" exportFunction

Expected Output During Compilation

-- int32 --
TRUE
FALSE
FALSE
-- references are dereferenced first --
TRUE
FALSE
-- unknown int32 --
Cond
-- Whole boundary cases --
FALSE
FALSE
-- text --
TRUE
FALSE

See also