summaryrefslogtreecommitdiffstats
path: root/lib.h
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 /lib.h
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 'lib.h')
-rw-r--r--lib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index cc8ef265..0872c089 100644
--- a/lib.h
+++ b/lib.h
@@ -717,6 +717,7 @@ val chr_isalpha(val ch);
val chr_isascii(val ch);
val chr_iscntrl(val ch);
val chr_isdigit(val ch);
+val chr_digit(val ch);
val chr_isgraph(val ch);
val chr_islower(val ch);
val chr_isprint(val ch);
@@ -726,6 +727,7 @@ val chr_isblank(val ch);
val chr_isunisp(val ch);
val chr_isupper(val ch);
val chr_isxdigit(val ch);
+val chr_xdigit(val ch);
val chr_toupper(val ch);
val chr_tolower(val ch);
val int_chr(val ch);