# HG changeset patch # User Aidan Kehoe # Date 1272552561 -3600 # Node ID 1096ef427b56483139a80b59cc1bc3e107d92886 # Parent 39d74978fd3297103f7ffdab6b72b54412be2aca Error on too many arguments to #'function, #'quote. 2010-04-29 Aidan Kehoe * eval.c (Fquote, Ffunction): Error on more than one argument to these special operators. * data.c (syms_of_data): Move Qquote to general-slots.h from this file, now it's used in eval.c diff -r 39d74978fd32 -r 1096ef427b56 src/ChangeLog --- a/src/ChangeLog Sat Apr 17 10:40:03 2010 +0100 +++ b/src/ChangeLog Thu Apr 29 15:49:21 2010 +0100 @@ -1,3 +1,10 @@ +2010-04-29 Aidan Kehoe + + * eval.c (Fquote, Ffunction): Error on more than one argument to + these special operators. + * data.c (syms_of_data): Move Qquote to general-slots.h from this + file, now it's used in eval.c + 2010-04-17 Aidan Kehoe * doc.c (Fdocumentation): diff -r 39d74978fd32 -r 1096ef427b56 src/data.c --- a/src/data.c Sat Apr 17 10:40:03 2010 +0100 +++ b/src/data.c Thu Apr 29 15:49:21 2010 +0100 @@ -34,7 +34,7 @@ #include "syssignal.h" #include "sysfloat.h" -Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; +Lisp_Object Qnil, Qt, Qlambda, Qunbound; Lisp_Object Qerror_conditions, Qerror_message; Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax; Lisp_Object Qlist_formation_error, Qstructure_formation_error; @@ -3516,7 +3516,6 @@ INIT_LISP_OBJECT (ephemeron); INIT_LISP_OBJECT (weak_box); - DEFSYMBOL (Qquote); DEFSYMBOL (Qlambda); DEFSYMBOL (Qlistp); DEFSYMBOL (Qtrue_list_p); diff -r 39d74978fd32 -r 1096ef427b56 src/eval.c --- a/src/eval.c Sat Apr 17 10:40:03 2010 +0100 +++ b/src/eval.c Thu Apr 29 15:49:21 2010 +0100 @@ -1273,6 +1273,15 @@ */ (args)) { + int nargs; + + GET_LIST_LENGTH (args, nargs); + if (nargs != 1) + { + Fsignal (Qwrong_number_of_arguments, + list2 (Qquote, make_int (nargs))); + } + return XCAR (args); } @@ -1344,6 +1353,15 @@ */ (args)) { + int nargs; + + GET_LIST_LENGTH (args, nargs); + if (nargs != 1) + { + Fsignal (Qwrong_number_of_arguments, + list2 (Qfunction, make_int (nargs))); + } + return XCAR (args); } diff -r 39d74978fd32 -r 1096ef427b56 src/general-slots.h --- a/src/general-slots.h Sat Apr 17 10:40:03 2010 +0100 +++ b/src/general-slots.h Thu Apr 29 15:49:21 2010 +0100 @@ -240,6 +240,7 @@ SYMBOL (Qquery_coding_warning_face); SYMBOL (Qquestion); SYMBOL_KEYWORD (Q_question); +SYMBOL (Qquote); SYMBOL (Qradio); SYMBOL (Qrassoc); SYMBOL (Qrassq);