next up previous
Contents Next: and (MACRO) Up: Appendix: Selected LISP Previous: = (PREDICATE)

<, >, <=, >= (PREDICATES)

Format: (< <num1> <num2> ... ) (> <num1> <num2> ... ) (<= <num1> <num2> ... ) (>= <num1> <num2> ... )

Required arguments: 1

<num1> <num2> ... must evaluate to numbers.

Returns T if the sequence of arguments is ordered (<: ascending, >: descending) or partially ordered (<=: less than or equal, >=: greater than or equal). Otherwise returns nil.

Examples:

>(< 2 67)
T

>(< 67 2)
NIL

>(> 67 2)
T

>(< 3 6 9)
T

>(< 4)
T

>(< 2 2 6)
NIL

>(<= 2 2 6)
T

>(>= 2 2 6)
NIL

>(< 6/2 3.0)
NIL



© Colin Allen & Maneesh Dhagat
November 1999