if

The conditional operator if requires three objects on the stack: an integer value and two executable arrays, which are program data. The first executable array will be executed if the integer value is not 0. The second executable array will be executed if the integer value is 0. For example, the program line
    1 { op1 } {op2} ifelse
executes { op1 } and the program line
    0 { op1 } {op2} ifelse
executes { op2 }.

Here is a list of comparison operators.

eq     $=$     Example: [1 2] [1 3] eq
gt     $>$     Example: 3 2 gt
lt     $<$     Example: 3 2 lt
not     Example: 3 2 eq not
and     Example: 3 2 eq 5 6 lt and
or     Example: 3 2 eq 5 6 lt or



Nobuki Takayama 2020-11-24