Mercurial > hg > xemacs-beta
comparison src/number.h @ 5864:750fab17b299
Make #'parse-integer Lisp-visible, extend it, allowing non-ASCII digits.
src/ChangeLog addition:
2015-02-25 Aidan Kehoe <kehoea@parhasard.net>
* lread.c (read_atom): Use the new calling convention for
parse_integer().
* lisp.h: Change the declaration of parse_integer ().
* number.h (bignum_set_emacs_int, make_bignum_emacs_uint):
New #defines, used in data.c.
* lread.c (read_integer): Ditto.
* lread.c (read1): Ditto.
* data.c (find_highest_value): New.
* data.c (fill_ichar_array): New.
* data.c (build_fixnum_to_char_map): New.
* data.c (Fset_digit_fixnum_map): New.
* data.c (Fdigit_char_p): Moved from cl-extra.el.
* data.c (Fdigit_char): Moved from cl-extra.el.
* data.c (parse_integer): Moved from lread.c.
* data.c (Fparse_integer): Made available to Lisp.
* data.c (syms_of_data): Make the new subrs available.
* data.c (vars_of_data): Make the new vars available.
Expose parse_integer to Lisp, make it follow the Common Lisp API
(with some extensions, to allow us to support non ASCII digit
characters).
lisp/ChangeLog addition:
2015-02-25 Aidan Kehoe <kehoea@parhasard.net>
* cl-extra.el (digit-char-p): Moved to data.c.
* cl-extra.el (digit-char): Moved to data.c.
tests/ChangeLog addition:
2015-02-25 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
parse_integer(), used in #'read, now signals invalid-argument
rather than invalid-read-syntax, check for that.
* automated/lisp-tests.el:
Check #'parse-integer now it's available to Lisp, check
#'digit-char, #'digit-char-p and the congruence in behaviour,
check the XEmacs-specific RADIX-TABLE argument behaviour.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 25 Feb 2015 11:47:12 +0000 |
parents | 4d7032d36975 |
children |
comparison
equal
deleted
inserted
replaced
5844:83e5c3cd6be6 | 5864:750fab17b299 |
---|---|
99 } while (0) | 99 } while (0) |
100 | 100 |
101 #if SIZEOF_EMACS_INT == SIZEOF_LONG | 101 #if SIZEOF_EMACS_INT == SIZEOF_LONG |
102 # define bignum_fits_emacs_int_p(b) bignum_fits_long_p(b) | 102 # define bignum_fits_emacs_int_p(b) bignum_fits_long_p(b) |
103 # define bignum_to_emacs_int(b) bignum_to_long(b) | 103 # define bignum_to_emacs_int(b) bignum_to_long(b) |
104 # define bignum_set_emacs_int bignum_set_long | |
105 # define make_bignum_emacs_uint(b) make_bignum_un(b) | |
104 #elif SIZEOF_EMACS_INT == SIZEOF_INT | 106 #elif SIZEOF_EMACS_INT == SIZEOF_INT |
105 # define bignum_fits_emacs_int_p(b) bignum_fits_int_p(b) | 107 # define bignum_fits_emacs_int_p(b) bignum_fits_int_p(b) |
106 # define bignum_to_emacs_int(b) bignum_to_int(b) | 108 # define bignum_to_emacs_int(b) bignum_to_int(b) |
109 # define bignum_set_emacs_int bignum_set_long | |
110 # define make_bignum_emacs_uint(b) make_bignum_un(b) | |
107 #else | 111 #else |
108 # define bignum_fits_emacs_int_p(b) bignum_fits_llong_p(b) | 112 # define bignum_fits_emacs_int_p(b) bignum_fits_llong_p(b) |
109 # define bignum_to_emacs_int(b) bignum_to_llong(b) | 113 # define bignum_to_emacs_int(b) bignum_to_llong(b) |
114 # define bignum_set_emacs_int bignum_set_llong | |
115 # define make_bignum_emacs_uint(b) make_bignum_ull(b) | |
110 #endif | 116 #endif |
111 | 117 |
112 extern Lisp_Object make_bignum (long); | 118 extern Lisp_Object make_bignum (long); |
113 extern Lisp_Object make_bignum_un (unsigned long); | 119 extern Lisp_Object make_bignum_un (unsigned long); |
114 extern Lisp_Object make_bignum_ll (long long); | 120 extern Lisp_Object make_bignum_ll (long long); |