Up Next Tail

#### 3.1 Elementary Predicates

Functions in this section return T when the condition defined is met and NIL when it is not. Defined are type checking functions and elementary comparisons.

Returns T if U is not a pair.
 EXPR PROCEDURE ATOM(U);

 NULL PAIRP U;

Returns T if U is a function-pointer.

Returns T if U is a constant (a number, string, function-pointer, or vector).
 EXPR PROCEDURE CONSTANTP(U);

 NULL OR(PAIRP U, IDP U);

Returns T if U points to the same object as V. EQ is not a reliable comparison between numeric arguments.

Returns T if U and V are EQ or if U and V are numbers and have the same value and type.

Returns T if U and V are the same. Dotted-pairs are compared recursively to the bottom levels of their trees. Vectors must have identical dimensions and EQUAL values in all positions. Strings must have identical characters. Function pointers must have EQ values. Other atoms must be EQN equal.

Returns T if U is an integer (a fixed number).

Returns T if U is a floating point number.

Returns T if U is an id.

Returns T if U is a number and less than 0. If U is not a number or is a positive number, NIL is returned.
 EXPR PROCEDURE MINUSP(U);

 IF NUMBERP U THEN LESSP(U, 0) ELSE NIL;

Returns T if U is NIL.
 EXPR PROCEDURE NULL(U);

 U EQ NIL;

Returns T if U is a number (integer or floating).
 EXPR PROCEDURE NUMBERP(U);

 IF OR(FIXP U, FLOATP U) THEN T ELSE NIL;

Returns T if U is a number and has the value 1 or 1.0. Returns NIL otherwise. a
 EXPR PROCEDURE ONEP(U);

 OR(EQN(U, 1), EQN(U, 1.0));

Returns T if U is a dotted-pair.

Returns T if U is a string.

Returns T if U is a vector.

Returns T if U is a number and has the value 0 or 0.0. Returns NIL otherwise.a
 EXPR PROCEDURE ZEROP(U);

 OR(EQN(U, 0), EQN(U, 0.0));

 Up Next Front