changeset 10161:512a84fb3c75

(Fdefconst, Fdefvar): Error if too many arguments.
author Richard M. Stallman <rms@gnu.org>
date Thu, 15 Dec 1994 00:42:19 +0000
parents 29c400c63312
children 58037e770f67
files src/eval.c
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Wed Dec 14 19:59:12 1994 +0000
+++ b/src/eval.c	Thu Dec 15 00:42:19 1994 +0000
@@ -571,18 +571,21 @@
   (args)
      Lisp_Object args;
 {
-  register Lisp_Object sym, tem;
+  register Lisp_Object sym, tem, tail;
 
   sym = Fcar (args);
-  tem = Fcdr (args);
-  if (!NILP (tem))
+  tail = Fcdr (args);
+  if (!NILP (Fcdr (Fcdr (tail))))
+    error ("too many arguments");
+
+  if (!NILP (tail))
     {
       tem = Fdefault_boundp (sym);
       if (NILP (tem))
 	Fset_default (sym, Feval (Fcar (Fcdr (args))));
     }
-  tem = Fcar (Fcdr (Fcdr (args)));
-  if (!NILP (tem))
+  tail = Fcdr (Fcdr (args));
+  if (!NILP (Fcar (tail)))
     {
       if (!NILP (Vpurify_flag))
 	tem = Fpurecopy (tem);
@@ -612,6 +615,9 @@
   register Lisp_Object sym, tem;
 
   sym = Fcar (args);
+  if (!NILP (Fcdr (Fcdr (Fcdr (args)))))
+    error ("too many arguments");
+
   Fset_default (sym, Feval (Fcar (Fcdr (args))));
   tem = Fcar (Fcdr (Fcdr (args)));
   if (!NILP (tem))