XLISP char-lessp

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# char-lessp

Type: | - | predicate function (subr)
Source: | - | xlstr.c

## Syntax

(char-lessp char1 charN ... )
  char1 - a character expression
  charN - character expression[s] to compare
  returns - T if the characters are of monotonically increasing ASCII value, NIL otherwise
  Note: case is not significant with this function

## Description

The 'char-lessp' function tests if all the character arguments are monotonically increasing. T is returned if the arguments are of increasing ASCII value, NIL otherwise. In the case of two arguments, this has the effect of testing if 'char1' is less than 'char2'. This test is case insensitive, the character '#\a' is considered to be the same ASCII value as the character '#\A'.

## Examples

    (char-lessp #\a #\b)      => T
    (char-lessp #\b #\a)      => NIL
    (char-lessp #\a #\b #\c)  => T
    (char-lessp #\a #\a)      => NIL
    (char-lessp #\a #\b #\b)  => NIL
    (char-lessp #\A #\a)      => NIL
    (char-lessp #\a #\A)      => NIL

See also:

- Contents → Character Functions

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference