]> code.delx.au - gnu-emacs/blobdiff - doc/misc/cl.texi
Add cl-parse-integer based on parse-integer
[gnu-emacs] / doc / misc / cl.texi
index b2914adc062cc24a3c4eb010cf3f230138ba9e46..04a0e5725e8895ec73c678ecbee553d898b7f422 100644 (file)
@@ -2929,6 +2929,12 @@ This predicate tests whether @var{integer} is even.  It is an
 error if the argument is not an integer.
 @end defun
 
+@defun cl-digit-char-p char radix
+Test if @var{char} is a digit in the specified @var{radix} (default is
+10).  If true return the decimal value of digit @var{char} in
+@var{radix}.
+@end defun
+
 @node Numerical Functions
 @section Numerical Functions
 
@@ -3011,6 +3017,15 @@ This function returns the same value as the second return value
 of @code{cl-truncate}.
 @end defun
 
+@defun cl-parse-integer string &key start end radix junk-allowed
+This function implements the Common Lisp @code{parse-integer}
+function.  It parses an integer in the specified @var{radix} from the
+substring of @var{string} between @var{start} and @var{end}.  Any
+leading and trailing whitespace chars are ignored. It signals an error
+if the substring between @var{start} and @var{end} cannot be parsed as
+an integer unless @var{junk-allowed} is non-nil.
+@end defun
+
 @node Random Numbers
 @section Random Numbers