diff src/eval.c @ 5207:1096ef427b56

Error on too many arguments to #'function, #'quote. 2010-04-29 Aidan Kehoe <kehoea@parhasard.net> * 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
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 29 Apr 2010 15:49:21 +0100
parents 88bd4f3ef8e4
children 18c0b5909d16
line wrap: on
line diff
--- 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);
 }