A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/HyperSpec/Body/f_digi_1.htm below:

CLHS: Function DIGIT-CHAR-P

Function DIGIT-CHAR-P

Syntax:

digit-char-p char &optional radix => weight

Arguments and Values:

char---a character.

radix---a radix. The default is 10.

weight---either a non-negative integer less than radix, or false.

Description:

Tests whether char is a digit in the specified radix (i.e., with a weight less than radix). If it is a digit in that radix, its weight is returned as an integer; otherwise nil is returned.

Examples:

 (digit-char-p #\5)    =>  5
 (digit-char-p #\5 2)  =>  false
 (digit-char-p #\A)    =>  false
 (digit-char-p #\a)    =>  false
 (digit-char-p #\A 11) =>  10
 (digit-char-p #\a 11) =>  10
 (mapcar #'(lambda (radix) 
             (map 'list #'(lambda (x) (digit-char-p x radix)) 
                  "059AaFGZ"))
         '(2 8 10 16 36))
 =>  ((0 NIL NIL NIL NIL NIL NIL NIL)
     (0 5 NIL NIL NIL NIL NIL NIL)
     (0 5 9 NIL NIL NIL NIL NIL)
     (0 5 9 10 10 15 NIL NIL)
     (0 5 9 10 10 15 16 35))

Affected By:

None. (In particular, the results of this predicate are independent of any special syntax which might have been enabled in the current readtable.)

Exceptional Situations: None.

See Also:

alphanumericp

Notes:

Digits are graphic characters.


Copyright 1996-2005, LispWorks Ltd. All rights reserved.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4