/[emacs]/emacs/src/eval.c
ViewVC logotype

Diff of /emacs/src/eval.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.203 by lektu, Wed Feb 12 15:44:40 2003 UTC revision 1.204 by monnier, Thu Apr 17 22:25:43 2003 UTC
# Line 294  usage: (or CONDITIONS ...)  */) Line 294  usage: (or CONDITIONS ...)  */)
294       (args)       (args)
295       Lisp_Object args;       Lisp_Object args;
296  {  {
297    register Lisp_Object val;    register Lisp_Object val = Qnil;
   Lisp_Object args_left;  
298    struct gcpro gcpro1;    struct gcpro gcpro1;
299    
300    if (NILP(args))    GCPRO1 (args);
     return Qnil;  
   
   args_left = args;  
   GCPRO1 (args_left);  
301    
302    do    while (CONSP (args))
303      {      {
304        val = Feval (Fcar (args_left));        val = Feval (XCAR (args));
305        if (!NILP (val))        if (!NILP (val))
306          break;          break;
307        args_left = Fcdr (args_left);        args = XCDR (args);
308      }      }
   while (!NILP(args_left));  
309    
310    UNGCPRO;    UNGCPRO;
311    return val;    return val;
# Line 325  usage: (and CONDITIONS ...)  */) Line 319  usage: (and CONDITIONS ...)  */)
319       (args)       (args)
320       Lisp_Object args;       Lisp_Object args;
321  {  {
322    register Lisp_Object val;    register Lisp_Object val = Qt;
   Lisp_Object args_left;  
323    struct gcpro gcpro1;    struct gcpro gcpro1;
324    
325    if (NILP(args))    GCPRO1 (args);
     return Qt;  
   
   args_left = args;  
   GCPRO1 (args_left);  
326    
327    do    while (CONSP (args))
328      {      {
329        val = Feval (Fcar (args_left));        val = Feval (XCAR (args));
330        if (NILP (val))        if (NILP (val))
331          break;          break;
332        args_left = Fcdr (args_left);        args = XCDR (args);
333      }      }
   while (!NILP(args_left));  
334    
335    UNGCPRO;    UNGCPRO;
336    return val;    return val;
# Line 410  usage: (progn BODY ...)  */) Line 398  usage: (progn BODY ...)  */)
398       (args)       (args)
399       Lisp_Object args;       Lisp_Object args;
400  {  {
401    register Lisp_Object val;    register Lisp_Object val = Qnil;
   Lisp_Object args_left;  
402    struct gcpro gcpro1;    struct gcpro gcpro1;
403    
404    if (NILP(args))    GCPRO1 (args);
     return Qnil;  
   
   args_left = args;  
   GCPRO1 (args_left);  
405    
406    do    while (CONSP (args))
407      {      {
408        val = Feval (Fcar (args_left));        val = Feval (XCAR (args));
409        args_left = Fcdr (args_left);        args = XCDR (args);
410      }      }
   while (!NILP(args_left));  
411    
412    UNGCPRO;    UNGCPRO;
413    return val;    return val;
# Line 662  The elements can look like this: Line 644  The elements can look like this:
644    (indent INDENT)    (indent INDENT)
645          Set NAME's `lisp-indent-function' property to INDENT.          Set NAME's `lisp-indent-function' property to INDENT.
646    
647    (edebug DEBUG)    (debug DEBUG)
648          Set NAME's `edebug-form-spec' property to DEBUG.  (This is          Set NAME's `edebug-form-spec' property to DEBUG.  (This is
649          equivalent to writing a `def-edebug-spec' for the macro.)          equivalent to writing a `def-edebug-spec' for the macro.)
650  usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...)  */)  usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...)  */)
# Line 680  usage: (defmacro NAME ARGLIST [DOCSTRING Line 662  usage: (defmacro NAME ARGLIST [DOCSTRING
662    doc = Qnil;    doc = Qnil;
663    if (STRINGP (Fcar (tail)))    if (STRINGP (Fcar (tail)))
664      {      {
665        doc = Fcar (tail);        doc = XCAR (tail);
666        tail = Fcdr (tail);        tail = XCDR (tail);
667      }      }
668    
669    while (CONSP (Fcar (tail))    while (CONSP (Fcar (tail))
# Line 775  usage: (defvar SYMBOL &optional INITVALU Line 757  usage: (defvar SYMBOL &optional INITVALU
757        if (NILP (tem))        if (NILP (tem))
758          Fset_default (sym, Feval (Fcar (tail)));          Fset_default (sym, Feval (Fcar (tail)));
759        tail = Fcdr (tail);        tail = Fcdr (tail);
760        if (!NILP (Fcar (tail)))        tem = Fcar (tail);
761          if (!NILP (tem))
762          {          {
           tem = Fcar (tail);  
763            if (!NILP (Vpurify_flag))            if (!NILP (Vpurify_flag))
764              tem = Fpurecopy (tem);              tem = Fpurecopy (tem);
765            Fput (sym, Qvariable_documentation, tem);            Fput (sym, Qvariable_documentation, tem);
# Line 1897  un_autoload (oldqueue) Line 1879  un_autoload (oldqueue)
1879    Vautoload_queue = oldqueue;    Vautoload_queue = oldqueue;
1880    while (CONSP (queue))    while (CONSP (queue))
1881      {      {
1882        first = Fcar (queue);        first = XCAR (queue);
1883        second = Fcdr (first);        second = Fcdr (first);
1884        first = Fcar (first);        first = Fcar (first);
1885        if (EQ (second, Qnil))        if (EQ (second, Qnil))
1886          Vfeatures = first;          Vfeatures = first;
1887        else        else
1888          Ffset (first, second);          Ffset (first, second);
1889        queue = Fcdr (queue);        queue = XCDR (queue);
1890      }      }
1891    return Qnil;    return Qnil;
1892  }  }
# Line 1943  do_autoload (fundef, funname) Line 1925  do_autoload (fundef, funname)
1925    queue = Vautoload_queue;    queue = Vautoload_queue;
1926    while (CONSP (queue))    while (CONSP (queue))
1927      {      {
1928        first = Fcar (queue);        first = XCAR (queue);
1929        second = Fcdr (first);        second = Fcdr (first);
1930        first = Fcar (first);        first = Fcar (first);
1931    
# Line 1951  do_autoload (fundef, funname) Line 1933  do_autoload (fundef, funname)
1933           may be an atom if the autoload entry was generated by a defalias           may be an atom if the autoload entry was generated by a defalias
1934           or fset.  */           or fset.  */
1935        if (CONSP (second))        if (CONSP (second))
1936          Fput (first, Qautoload, (Fcdr (second)));          Fput (first, Qautoload, (XCDR (second)));
1937    
1938        queue = Fcdr (queue);        queue = XCDR (queue);
1939      }      }
1940    
1941    /* Once loading finishes, don't undo it.  */    /* Once loading finishes, don't undo it.  */
# Line 2179  usage: (apply FUNCTION &rest ARGUMENTS) Line 2161  usage: (apply FUNCTION &rest ARGUMENTS)
2161    register Lisp_Object spread_arg;    register Lisp_Object spread_arg;
2162    register Lisp_Object *funcall_args;    register Lisp_Object *funcall_args;
2163    Lisp_Object fun;    Lisp_Object fun;
2164    struct gcpro gcpro1;    int nvars;
2165    
2166    fun = args [0];    fun = args [0];
2167    funcall_args = 0;    funcall_args = 0;
# Line 2219  usage: (apply FUNCTION &rest ARGUMENTS) Line 2201  usage: (apply FUNCTION &rest ARGUMENTS)
2201                                                   * sizeof (Lisp_Object));                                                   * sizeof (Lisp_Object));
2202            for (i = numargs; i < XSUBR (fun)->max_args;)            for (i = numargs; i < XSUBR (fun)->max_args;)
2203              funcall_args[++i] = Qnil;              funcall_args[++i] = Qnil;
2204            GCPRO1 (*funcall_args);            nvars = 1 + XSUBR (fun)->max_args;
           gcpro1.nvars = 1 + XSUBR (fun)->max_args;  
2205          }          }
2206      }      }
2207   funcall:   funcall:
# Line 2230  usage: (apply FUNCTION &rest ARGUMENTS) Line 2211  usage: (apply FUNCTION &rest ARGUMENTS)
2211      {      {
2212        funcall_args = (Lisp_Object *) alloca ((1 + numargs)        funcall_args = (Lisp_Object *) alloca ((1 + numargs)
2213                                               * sizeof (Lisp_Object));                                               * sizeof (Lisp_Object));
2214        GCPRO1 (*funcall_args);        nvars = 1 + numargs;
       gcpro1.nvars = 1 + numargs;  
2215      }      }
2216    
2217    bcopy (args, funcall_args, nargs * sizeof (Lisp_Object));    bcopy (args, funcall_args, nargs * sizeof (Lisp_Object));
# Line 2244  usage: (apply FUNCTION &rest ARGUMENTS) Line 2224  usage: (apply FUNCTION &rest ARGUMENTS)
2224        spread_arg = XCDR (spread_arg);        spread_arg = XCDR (spread_arg);
2225      }      }
2226    
2227    RETURN_UNGCPRO (Ffuncall (gcpro1.nvars, funcall_args));    return Ffuncall (nvars, funcall_args);
2228  }  }
2229    
2230  /* Run hook variables in various ways.  */  /* Run hook variables in various ways.  */

Legend:
Removed from v.1.203  
changed lines
  Added in v.1.204

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26