changeset 50630:dfbdcffdcfc9

(For, Fand, Fprogn, un_autoload, do_autoload): Use XCDR, XCAR, CONSP. (Fdefmacro): Fix docstring. Use XCAR, XCDR. (Fapply): Remove unnecessary GCPRO.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 17 Apr 2003 22:25:43 +0000
parents 36d13cf0f114
children 763258a2d395
files src/eval.c
diffstat 1 files changed, 33 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Thu Apr 17 21:58:34 2003 +0000
+++ b/src/eval.c	Thu Apr 17 22:25:43 2003 +0000
@@ -294,24 +294,18 @@
      (args)
      Lisp_Object args;
 {
-  register Lisp_Object val;
-  Lisp_Object args_left;
+  register Lisp_Object val = Qnil;
   struct gcpro gcpro1;
 
-  if (NILP(args))
-    return Qnil;
-
-  args_left = args;
-  GCPRO1 (args_left);
-
-  do
+  GCPRO1 (args);
+
+  while (CONSP (args))
     {
-      val = Feval (Fcar (args_left));
+      val = Feval (XCAR (args));
       if (!NILP (val))
 	break;
-      args_left = Fcdr (args_left);
+      args = XCDR (args);
     }
-  while (!NILP(args_left));
 
   UNGCPRO;
   return val;
@@ -325,24 +319,18 @@
      (args)
      Lisp_Object args;
 {
-  register Lisp_Object val;
-  Lisp_Object args_left;
+  register Lisp_Object val = Qt;
   struct gcpro gcpro1;
 
-  if (NILP(args))
-    return Qt;
-
-  args_left = args;
-  GCPRO1 (args_left);
-
-  do
+  GCPRO1 (args);
+
+  while (CONSP (args))
     {
-      val = Feval (Fcar (args_left));
+      val = Feval (XCAR (args));
       if (NILP (val))
 	break;
-      args_left = Fcdr (args_left);
+      args = XCDR (args);
     }
-  while (!NILP(args_left));
 
   UNGCPRO;
   return val;
@@ -410,22 +398,16 @@
      (args)
      Lisp_Object args;
 {
-  register Lisp_Object val;
-  Lisp_Object args_left;
+  register Lisp_Object val = Qnil;
   struct gcpro gcpro1;
 
-  if (NILP(args))
-    return Qnil;
-
-  args_left = args;
-  GCPRO1 (args_left);
-
-  do
+  GCPRO1 (args);
+
+  while (CONSP (args))
     {
-      val = Feval (Fcar (args_left));
-      args_left = Fcdr (args_left);
+      val = Feval (XCAR (args));
+      args = XCDR (args);
     }
-  while (!NILP(args_left));
 
   UNGCPRO;
   return val;
@@ -662,7 +644,7 @@
   (indent INDENT)
 	Set NAME's `lisp-indent-function' property to INDENT.
 
-  (edebug DEBUG)
+  (debug DEBUG)
 	Set NAME's `edebug-form-spec' property to DEBUG.  (This is
 	equivalent to writing a `def-edebug-spec' for the macro.)
 usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...)  */)
@@ -680,8 +662,8 @@
   doc = Qnil;
   if (STRINGP (Fcar (tail)))
     {
-      doc = Fcar (tail);
-      tail = Fcdr (tail);
+      doc = XCAR (tail);
+      tail = XCDR (tail);
     }
 
   while (CONSP (Fcar (tail))
@@ -775,9 +757,9 @@
       if (NILP (tem))
 	Fset_default (sym, Feval (Fcar (tail)));
       tail = Fcdr (tail);
-      if (!NILP (Fcar (tail)))
+      tem = Fcar (tail);
+      if (!NILP (tem))
 	{
-	  tem = Fcar (tail);
 	  if (!NILP (Vpurify_flag))
 	    tem = Fpurecopy (tem);
 	  Fput (sym, Qvariable_documentation, tem);
@@ -1897,14 +1879,14 @@
   Vautoload_queue = oldqueue;
   while (CONSP (queue))
     {
-      first = Fcar (queue);
+      first = XCAR (queue);
       second = Fcdr (first);
       first = Fcar (first);
       if (EQ (second, Qnil))
 	Vfeatures = first;
       else
 	Ffset (first, second);
-      queue = Fcdr (queue);
+      queue = XCDR (queue);
     }
   return Qnil;
 }
@@ -1943,7 +1925,7 @@
   queue = Vautoload_queue;
   while (CONSP (queue))
     {
-      first = Fcar (queue);
+      first = XCAR (queue);
       second = Fcdr (first);
       first = Fcar (first);
 
@@ -1951,9 +1933,9 @@
 	 may be an atom if the autoload entry was generated by a defalias
 	 or fset.  */
       if (CONSP (second))
-	Fput (first, Qautoload, (Fcdr (second)));
-
-      queue = Fcdr (queue);
+	Fput (first, Qautoload, (XCDR (second)));
+
+      queue = XCDR (queue);
     }
 
   /* Once loading finishes, don't undo it.  */
@@ -2179,7 +2161,7 @@
   register Lisp_Object spread_arg;
   register Lisp_Object *funcall_args;
   Lisp_Object fun;
-  struct gcpro gcpro1;
+  int nvars;
 
   fun = args [0];
   funcall_args = 0;
@@ -2219,8 +2201,7 @@
 						 * sizeof (Lisp_Object));
 	  for (i = numargs; i < XSUBR (fun)->max_args;)
 	    funcall_args[++i] = Qnil;
-	  GCPRO1 (*funcall_args);
-	  gcpro1.nvars = 1 + XSUBR (fun)->max_args;
+	  nvars = 1 + XSUBR (fun)->max_args;
 	}
     }
  funcall:
@@ -2230,8 +2211,7 @@
     {
       funcall_args = (Lisp_Object *) alloca ((1 + numargs)
 					     * sizeof (Lisp_Object));
-      GCPRO1 (*funcall_args);
-      gcpro1.nvars = 1 + numargs;
+      nvars = 1 + numargs;
     }
 
   bcopy (args, funcall_args, nargs * sizeof (Lisp_Object));
@@ -2244,7 +2224,7 @@
       spread_arg = XCDR (spread_arg);
     }
 
-  RETURN_UNGCPRO (Ffuncall (gcpro1.nvars, funcall_args));
+  return Ffuncall (nvars, funcall_args);
 }
 
 /* Run hook variables in various ways.  */