The 'digit-char-p' predicate function checks if the 'char' expression is
a numeric digit. If 'char' is numeric digit, the equivalent integer value
is returned, otherwise a NIL is
returned. Decimal digits are '0' [ASCII decimal
(digit-char-p #\0) ; returns 0 (digit-char-p #\9) ; returns 9 (digit-char-p #\A) ; returns NIL (digit-char-p #\a) ; returns NIL (digit-char-p #\.) ; returns NIL (digit-char-p #\-) ; returns NIL (digit-char-p #\+) ; returns NIL
Note: Other non-digit characters used in numbers are NOT included:
plus [+], minus [-], exponent
Common Lisp: Common Lisp supports the use of an optional radix parameter. This option specifies numeric base. This allows the 'digit-char-p' to function properly for hexadecimal digits [for example]. Common LISP supports up to base 36 radix systems. XLISP does not support this radix parameter.
See the
digit-char-p
predicate function in the