comparison src/eval.c @ 82463:617c0965e1f4

(Ffunction, Fquote): Signal error if not 1 argument.
author Richard M. Stallman <rms@gnu.org>
date Sun, 19 Aug 2007 01:56:15 +0000
parents b3fc112aac24
children 2a69b973fae2 aaccdab0ee26
comparison
equal deleted inserted replaced
82462:4832d8e5a326 82463:617c0965e1f4
200 200
201 Lisp_Object Vmacro_declaration_function; 201 Lisp_Object Vmacro_declaration_function;
202 202
203 extern Lisp_Object Qrisky_local_variable; 203 extern Lisp_Object Qrisky_local_variable;
204 204
205 extern Lisp_Object Qfunction;
206
205 static Lisp_Object funcall_lambda P_ ((Lisp_Object, int, Lisp_Object*)); 207 static Lisp_Object funcall_lambda P_ ((Lisp_Object, int, Lisp_Object*));
206 static void unwind_to_catch P_ ((struct catchtag *, Lisp_Object)) NO_RETURN; 208 static void unwind_to_catch P_ ((struct catchtag *, Lisp_Object)) NO_RETURN;
207 209
208 #if __GNUC__ 210 #if __GNUC__
209 /* "gcc -O3" enables automatic function inlining, which optimizes out 211 /* "gcc -O3" enables automatic function inlining, which optimizes out
537 { 539 {
538 register Lisp_Object args_left; 540 register Lisp_Object args_left;
539 register Lisp_Object val, sym; 541 register Lisp_Object val, sym;
540 struct gcpro gcpro1; 542 struct gcpro gcpro1;
541 543
542 if (NILP(args)) 544 if (NILP (args))
543 return Qnil; 545 return Qnil;
544 546
545 args_left = args; 547 args_left = args;
546 GCPRO1 (args); 548 GCPRO1 (args);
547 549
562 doc: /* Return the argument, without evaluating it. `(quote x)' yields `x'. 564 doc: /* Return the argument, without evaluating it. `(quote x)' yields `x'.
563 usage: (quote ARG) */) 565 usage: (quote ARG) */)
564 (args) 566 (args)
565 Lisp_Object args; 567 Lisp_Object args;
566 { 568 {
569 if (!NILP (Fcdr (args)))
570 xsignal2 (Qwrong_number_of_arguments, Qquote, Flength (args));
567 return Fcar (args); 571 return Fcar (args);
568 } 572 }
569 573
570 DEFUN ("function", Ffunction, Sfunction, 1, UNEVALLED, 0, 574 DEFUN ("function", Ffunction, Sfunction, 1, UNEVALLED, 0,
571 doc: /* Like `quote', but preferred for objects which are functions. 575 doc: /* Like `quote', but preferred for objects which are functions.
573 `quote' cannot do that. 577 `quote' cannot do that.
574 usage: (function ARG) */) 578 usage: (function ARG) */)
575 (args) 579 (args)
576 Lisp_Object args; 580 Lisp_Object args;
577 { 581 {
582 if (!NILP (Fcdr (args)))
583 xsignal2 (Qwrong_number_of_arguments, Qfunction, Flength (args));
578 return Fcar (args); 584 return Fcar (args);
579 } 585 }
580 586
581 587
582 DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0, 588 DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0,