These predicate functions perform various object comparisons and either succeed returning a null string or cause statement failure. Any of these functions can be redefined by the user.
DIFFER(a,b) or differ(a,b) succeeds only if a and b are not identical. Copies of strings and integers with equal values are considered identical. For other data types, the two arguments must return a reference to the same instance of that data type to be considered identical. When comparing NANs (Not a Number), they will only be considered identical if they were created at the same time (in the same statement and at the same &STCOUNT). Thus a NAN generated from 0.0 / 0.0 will not be identical to &NAN.
IDENT(a,b) or ident(a,b) succeeds only if a and b are identical. Copies of strings and integers with equal values are considered identical. For other data types, the two arguments must return a reference to the same instance of that data type to be considered identical. When comparing NANs (Not a Number), they will only be considered identical if they were created at the same time (same statement and &STCOUNT). Thus a NAN generated from 0.0 / 0.0 will not be identical to &NAN.
ISNAN(x) or isnan(x) succeeds only if x is a NAN (Not a Number) per the IEEE standard for floating point. If x is not of type REAL or not a NAN, then the function fails.
LABEL(s) or label(s) succeeds only if the string s is a LABEL to some SNOBOL code. If x is not a LABEL, then the function fails.
LEQ(a,b) or leq(a,b) succeeds if string a is lexically equal to string b.
LGE(a,b) or lge(a,b) succeeds if string a is lexically greater than or equal to string b. The collating sequence followed is available in &ALPHABET. If one string is shorter than the other, and the shorter string is the initial substring of the longer string, then the longer string is lexically greater than the shorter string.
LGT(a,b) or lgt(a,b) succeeds if string a is lexically greater than string b. The collating sequence followed is available in &ALPHABET. If one string is shorter than the other, and the shorter string is the initial substring of the longer string, then the longer string is lexically greater than the shorter string.
LLE(a,b) or lle(a,b) succeeds if string a is lexically less than or equal to string b. The collating sequence followed is available in &ALPHABET. If one string is shorter than the other, and the shorter string is the initial substring of the longer string, then the longer string is lexically greater than the shorter string.
LLT(a,b) or llt(a,b) succeeds if string a is lexically less than string b. The collating sequence followed is available in &ALPHABET. If one string is shorter than the other, and the shorter string is the initial substring of the longer string, then the longer string is lexically greater than the shorter string.
LNE(a,b) or lne(a,b) succeeds if string a is lexically not equal to string b.
Prior Page, Next Page, First Page of the Oregon SNOBOL5 Reference