Mercurial > hg > xemacs-beta
diff src/fns.c @ 5277:d804e621add0
Simplify the API of PARSE_KEYWORDS for callers.
src/ChangeLog addition:
2010-09-18 Aidan Kehoe <kehoea@parhasard.net>
Simplify the API of PARSE_KEYWORDS for callers.
* lisp.h (PARSE_KEYWORDS): Simply the API, while making the
implementation a little more complex; work out KEYWORDS_OFFSET
from the appropriate Lisp_Subr struct, take the function name as
the C name of the DEFUN rather than a symbol visible as a
Lisp_Object, on debug builds assert that we're actually in the
function so we choke on badly-done copy-and-pasting,
* lisp.h (PARSE_KEYWORDS_8): New. This is the old PARSE_KEYWORDS.
* fns.c (Fmerge, FsortX, Ffill, Freduce, Freplace):
Change to use the new PARSE_KEYWORDS syntax.
* elhash.c (Fmake_hash_table): Chance to the new PARSE_KEYWORDS
syntax, rename a define to correspond to what other files use.
* symbols.c (intern_massaging_name):
* buffer.c (ADD_INT):
Rename intern_converting_underscores_to_dashes() to
intern_massaging_name(), now it does a little more.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 18 Sep 2010 15:57:20 +0100 |
parents | 5a9aa6c40c9b |
children | be436ac36ba4 308d34e9f07d |
line wrap: on
line diff
--- a/src/fns.c Sat Sep 18 15:03:54 2010 +0100 +++ b/src/fns.c Sat Sep 18 15:57:20 2010 +0100 @@ -2575,7 +2575,7 @@ Lisp_Object (*c_predicate) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); - PARSE_KEYWORDS (Qmerge, nargs, args, 4, 1, (key), NULL, 0); + PARSE_KEYWORDS (Fmerge, nargs, args, 1, (key), NULL); CHECK_SEQUENCE (sequence_one); CHECK_SEQUENCE (sequence_two); @@ -2827,7 +2827,7 @@ Lisp_Object); Elemcount sequence_len, i; - PARSE_KEYWORDS (QsortX, nargs, args, 2, 1, (key), NULL, 0); + PARSE_KEYWORDS (FsortX, nargs, args, 1, (key), NULL); CHECK_SEQUENCE (sequence); @@ -4002,7 +4002,7 @@ Lisp_Object item = args[1]; Elemcount starting = 0, ending = EMACS_INT_MAX, ii, len; - PARSE_KEYWORDS (Qfill, nargs, args, 2, 2, (start, end), (start = Qzero), 0); + PARSE_KEYWORDS (Ffill, nargs, args, 2, (start, end), (start = Qzero)); CHECK_NATNUM (start); starting = XINT (start); @@ -5005,9 +5005,9 @@ Lisp_Object function = args[0], sequence = args[1], accum = Qunbound; Elemcount starting, ending = EMACS_INT_MAX, ii = 0; - PARSE_KEYWORDS (Qreduce, nargs, args, 2, 5, + PARSE_KEYWORDS (Freduce, nargs, args, 5, (start, end, from_end, initial_value, key), - (start = Qzero, initial_value = Qunbound), 0); + (start = Qzero, initial_value = Qunbound)); CHECK_SEQUENCE (sequence); CHECK_NATNUM (start); @@ -5541,8 +5541,8 @@ Boolint sequence1_listp, sequence2_listp, overwriting = EQ (sequence1, sequence2); - PARSE_KEYWORDS (Qreplace, nargs, args, 2, 4, (start1, end1, start2, end2), - (start1 = start2 = Qzero), 0); + PARSE_KEYWORDS (Freplace, nargs, args, 4, (start1, end1, start2, end2), + (start1 = start2 = Qzero)); CHECK_SEQUENCE (sequence1); CHECK_LISP_WRITEABLE (sequence1);