summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-01-04 20:33:14 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-01-04 20:33:14 -0800
commit66dae5a4d72765c80d5cd97f5f16a4d095d79f2f (patch)
tree279d050457fbbfcd291e1160c52c4e5bb1d7d899 /txr.1
parent11ac283d7eda2bac2f19d62d014043f66c8de84c (diff)
downloadtxr-66dae5a4d72765c80d5cd97f5f16a4d095d79f2f.tar.gz
txr-66dae5a4d72765c80d5cd97f5f16a4d095d79f2f.tar.bz2
txr-66dae5a4d72765c80d5cd97f5f16a4d095d79f2f.zip
Revert chr-isdigit/isxdigit, provide new functions.
It was a mistake to change the semantics of the return value of chr-isdigit and chr-isdigit. It breaks code like [partition-by chr-isdigit ...]. The behavior of chr-isdigit and chr-isxdigit is restored to returning t and nil. New chr-digit and chr-xdigit functions are introduced for returning the digit value or nil. * eval.c (eval_init): Register chr-digit and chr-xdigit intrinsics. * lib.c (chr_isdigit, chr_isxdigit): Restore old behavior. (chr_digit, chr_xdigit): New functions. * lib.h (chr_digit, chr_xdigit): Declared. * txr.1: Everything documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.126
1 files changed, 18 insertions, 8 deletions
diff --git a/txr.1 b/txr.1
index fb2a91a6..0a1283c0 100644
--- a/txr.1
+++ b/txr.1
@@ -17643,17 +17643,22 @@ ranges from 0 to 31, or is 127. In other words, any non-printable ASCII
character. For other characters, it returns
.codn nil .
-.coNP Function @ chr-isdigit
+.coNP Functions @ chr-isdigit and @ chr-digit
.synb
.mets (chr-isdigit << char )
+.mets (chr-digit << char )
.syne
.desc
If
.meta char
-is is an ASCII digit character,
+is is an ASCII decimal digit character,
.code chr-isdigit
-returns the integer value, 0 to 9, corresponding to that character.
-Otherwise, it returns
+returns the value
+.code t
+and
+.code chr-digit
+returns the integer value corresponding to that digit character,
+a value in the range 0 to 9. Otherwise, both functions return
.codn nil .
.coNP Function @ chr-isgraph
@@ -17800,18 +17805,23 @@ if
is an ASCII upper case letter. Otherwise it returns
.codn nil .
-.coNP Function @ chr-isxdigit
+.coNP Function @ chr-isxdigit and @ chr-xdigit
.synb
.mets (chr-isxdigit << char )
+.mets (chr-xdigit << char )
.syne
.desc
If
.meta char
is a hexadecimal digit character,
.code chr-isxdigit
-returns its integer value 0 to 15.
-Otherwise it returns
-.codn nil .
+returns the value
+.code t
+and
+.code chr-xdigit
+returns the integer value corresponding to that digit character,
+a value in the range 0 to 15. Otherwise, both functions returns
+.codn nil .
A hexadecimal digit is one of the ASCII
digit characters