comparison src/eval.c @ 41846:680de0f18330

Undo last change. Consistency doesn't seem to be desired.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 06 Dec 2001 16:21:23 +0000
parents 50b6bc7ee607
children fd38a0b6a3ff
comparison
equal deleted inserted replaced
41845:23120b6a0225 41846:680de0f18330
284 284
285 DEFUN ("or", For, Sor, 0, UNEVALLED, 0, 285 DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
286 doc: /* Eval args until one of them yields non-nil, then return that value. 286 doc: /* Eval args until one of them yields non-nil, then return that value.
287 The remaining args are not evalled at all. 287 The remaining args are not evalled at all.
288 If all args return nil, return nil. 288 If all args return nil, return nil.
289 usage: (or &rest CONDITIONS) */) 289 usage: (or CONDITIONS ...) */)
290 (args) 290 (args)
291 Lisp_Object args; 291 Lisp_Object args;
292 { 292 {
293 register Lisp_Object val; 293 register Lisp_Object val;
294 Lisp_Object args_left; 294 Lisp_Object args_left;
315 315
316 DEFUN ("and", Fand, Sand, 0, UNEVALLED, 0, 316 DEFUN ("and", Fand, Sand, 0, UNEVALLED, 0,
317 doc: /* Eval args until one of them yields nil, then return nil. 317 doc: /* Eval args until one of them yields nil, then return nil.
318 The remaining args are not evalled at all. 318 The remaining args are not evalled at all.
319 If no arg yields nil, return the last arg's value. 319 If no arg yields nil, return the last arg's value.
320 usage: (and &rest CONDITIONS) */) 320 usage: (and CONDITIONS ...) */)
321 (args) 321 (args)
322 Lisp_Object args; 322 Lisp_Object args;
323 { 323 {
324 register Lisp_Object val; 324 register Lisp_Object val;
325 Lisp_Object args_left; 325 Lisp_Object args_left;
347 DEFUN ("if", Fif, Sif, 2, UNEVALLED, 0, 347 DEFUN ("if", Fif, Sif, 2, UNEVALLED, 0,
348 doc: /* If COND yields non-nil, do THEN, else do ELSE... 348 doc: /* If COND yields non-nil, do THEN, else do ELSE...
349 Returns the value of THEN or the value of the last of the ELSE's. 349 Returns the value of THEN or the value of the last of the ELSE's.
350 THEN must be one expression, but ELSE... can be zero or more expressions. 350 THEN must be one expression, but ELSE... can be zero or more expressions.
351 If COND yields nil, and there are no ELSE's, the value is nil. 351 If COND yields nil, and there are no ELSE's, the value is nil.
352 usage: (if COND THEN &rest ELSE) */) 352 usage: (if COND THEN ELSE...) */)
353 (args) 353 (args)
354 Lisp_Object args; 354 Lisp_Object args;
355 { 355 {
356 register Lisp_Object cond; 356 register Lisp_Object cond;
357 struct gcpro gcpro1; 357 struct gcpro gcpro1;
372 then the expressions in BODY are evaluated and the last one's 372 then the expressions in BODY are evaluated and the last one's
373 value is the value of the cond-form. 373 value is the value of the cond-form.
374 If no clause succeeds, cond returns nil. 374 If no clause succeeds, cond returns nil.
375 If a clause has one element, as in (CONDITION), 375 If a clause has one element, as in (CONDITION),
376 CONDITION's value if non-nil is returned from the cond-form. 376 CONDITION's value if non-nil is returned from the cond-form.
377 usage: (cond &rest CLAUSES) */) 377 usage: (cond CLAUSES...) */)
378 (args) 378 (args)
379 Lisp_Object args; 379 Lisp_Object args;
380 { 380 {
381 register Lisp_Object clause, val; 381 register Lisp_Object clause, val;
382 struct gcpro gcpro1; 382 struct gcpro gcpro1;
400 return val; 400 return val;
401 } 401 }
402 402
403 DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0, 403 DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0,
404 doc: /* Eval BODY forms sequentially and return value of last one. 404 doc: /* Eval BODY forms sequentially and return value of last one.
405 usage: (progn &rest BODY) */) 405 usage: (progn BODY ...) */)
406 (args) 406 (args)
407 Lisp_Object args; 407 Lisp_Object args;
408 { 408 {
409 register Lisp_Object val, tem; 409 register Lisp_Object val, tem;
410 Lisp_Object args_left; 410 Lisp_Object args_left;
441 441
442 DEFUN ("prog1", Fprog1, Sprog1, 1, UNEVALLED, 0, 442 DEFUN ("prog1", Fprog1, Sprog1, 1, UNEVALLED, 0,
443 doc: /* Eval FIRST and BODY sequentially; value from FIRST. 443 doc: /* Eval FIRST and BODY sequentially; value from FIRST.
444 The value of FIRST is saved during the evaluation of the remaining args, 444 The value of FIRST is saved during the evaluation of the remaining args,
445 whose values are discarded. 445 whose values are discarded.
446 usage: (prog1 FIRST &rest BODY) */) 446 usage: (prog1 FIRST BODY...) */)
447 (args) 447 (args)
448 Lisp_Object args; 448 Lisp_Object args;
449 { 449 {
450 Lisp_Object val; 450 Lisp_Object val;
451 register Lisp_Object args_left; 451 register Lisp_Object args_left;
475 475
476 DEFUN ("prog2", Fprog2, Sprog2, 2, UNEVALLED, 0, 476 DEFUN ("prog2", Fprog2, Sprog2, 2, UNEVALLED, 0,
477 doc: /* Eval X, Y and BODY sequentially; value from Y. 477 doc: /* Eval X, Y and BODY sequentially; value from Y.
478 The value of Y is saved during the evaluation of the remaining args, 478 The value of Y is saved during the evaluation of the remaining args,
479 whose values are discarded. 479 whose values are discarded.
480 usage: (prog2 X Y &rest BODY) */) 480 usage: (prog2 X Y BODY...) */)
481 (args) 481 (args)
482 Lisp_Object args; 482 Lisp_Object args;
483 { 483 {
484 Lisp_Object val; 484 Lisp_Object val;
485 register Lisp_Object args_left; 485 register Lisp_Object args_left;
635 635
636 DEFUN ("defun", Fdefun, Sdefun, 2, UNEVALLED, 0, 636 DEFUN ("defun", Fdefun, Sdefun, 2, UNEVALLED, 0,
637 doc: /* Define NAME as a function. 637 doc: /* Define NAME as a function.
638 The definition is (lambda ARGLIST [DOCSTRING] BODY...). 638 The definition is (lambda ARGLIST [DOCSTRING] BODY...).
639 See also the function `interactive'. 639 See also the function `interactive'.
640 usage: (defun NAME ARGLIST &optional DOCSTRING &rest BODY) */) 640 usage: (defun NAME ARGLIST [DOCSTRING] BODY...) */)
641 (args) 641 (args)
642 Lisp_Object args; 642 Lisp_Object args;
643 { 643 {
644 register Lisp_Object fn_name; 644 register Lisp_Object fn_name;
645 register Lisp_Object defn; 645 register Lisp_Object defn;
658 The definition is (macro lambda ARGLIST [DOCSTRING] BODY...). 658 The definition is (macro lambda ARGLIST [DOCSTRING] BODY...).
659 When the macro is called, as in (NAME ARGS...), 659 When the macro is called, as in (NAME ARGS...),
660 the function (lambda ARGLIST BODY...) is applied to 660 the function (lambda ARGLIST BODY...) is applied to
661 the list ARGS... as it appears in the expression, 661 the list ARGS... as it appears in the expression,
662 and the result should be a form to be evaluated instead of the original. 662 and the result should be a form to be evaluated instead of the original.
663 usage: (defmacro NAME ARGLIST &optional DOCSTRING &rest BODY) */) 663 usage: (defmacro NAME ARGLIST [DOCSTRING] BODY...) */)
664 (args) 664 (args)
665 Lisp_Object args; 665 Lisp_Object args;
666 { 666 {
667 register Lisp_Object fn_name; 667 register Lisp_Object fn_name;
668 register Lisp_Object defn; 668 register Lisp_Object defn;
758 The intent is that neither programs nor users should ever change this value. 758 The intent is that neither programs nor users should ever change this value.
759 Always sets the value of SYMBOL to the result of evalling INITVALUE. 759 Always sets the value of SYMBOL to the result of evalling INITVALUE.
760 If SYMBOL is buffer-local, its default value is what is set; 760 If SYMBOL is buffer-local, its default value is what is set;
761 buffer-local values are not affected. 761 buffer-local values are not affected.
762 DOCSTRING is optional. 762 DOCSTRING is optional.
763 usage: (defconst SYMBOL INITVALUE &optional DOCSTRING) */) 763 usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
764 (args) 764 (args)
765 Lisp_Object args; 765 Lisp_Object args;
766 { 766 {
767 register Lisp_Object sym, tem; 767 register Lisp_Object sym, tem;
768 768
824 doc: /* Bind variables according to VARLIST then eval BODY. 824 doc: /* Bind variables according to VARLIST then eval BODY.
825 The value of the last form in BODY is returned. 825 The value of the last form in BODY is returned.
826 Each element of VARLIST is a symbol (which is bound to nil) 826 Each element of VARLIST is a symbol (which is bound to nil)
827 or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM). 827 or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).
828 Each VALUEFORM can refer to the symbols already bound by this VARLIST. 828 Each VALUEFORM can refer to the symbols already bound by this VARLIST.
829 usage: (let* VARLIST &rest BODY) */) 829 usage: (let* VARLIST BODY...) */)
830 (args) 830 (args)
831 Lisp_Object args; 831 Lisp_Object args;
832 { 832 {
833 Lisp_Object varlist, val, elt; 833 Lisp_Object varlist, val, elt;
834 int count = specpdl_ptr - specpdl; 834 int count = specpdl_ptr - specpdl;
863 doc: /* Bind variables according to VARLIST then eval BODY. 863 doc: /* Bind variables according to VARLIST then eval BODY.
864 The value of the last form in BODY is returned. 864 The value of the last form in BODY is returned.
865 Each element of VARLIST is a symbol (which is bound to nil) 865 Each element of VARLIST is a symbol (which is bound to nil)
866 or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM). 866 or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).
867 All the VALUEFORMs are evalled before any symbols are bound. 867 All the VALUEFORMs are evalled before any symbols are bound.
868 usage: (let VARLIST &rest BODY) */) 868 usage: (let VARLIST BODY...) */)
869 (args) 869 (args)
870 Lisp_Object args; 870 Lisp_Object args;
871 { 871 {
872 Lisp_Object *temps, tem; 872 Lisp_Object *temps, tem;
873 register Lisp_Object elt, varlist; 873 register Lisp_Object elt, varlist;
919 919
920 DEFUN ("while", Fwhile, Swhile, 1, UNEVALLED, 0, 920 DEFUN ("while", Fwhile, Swhile, 1, UNEVALLED, 0,
921 doc: /* If TEST yields non-nil, eval BODY... and repeat. 921 doc: /* If TEST yields non-nil, eval BODY... and repeat.
922 The order of execution is thus TEST, BODY, TEST, BODY and so on 922 The order of execution is thus TEST, BODY, TEST, BODY and so on
923 until TEST returns nil. 923 until TEST returns nil.
924 usage: (while TEST &rest BODY) */) 924 usage: (while TEST BODY...) */)
925 (args) 925 (args)
926 Lisp_Object args; 926 Lisp_Object args;
927 { 927 {
928 Lisp_Object test, body, tem; 928 Lisp_Object test, body, tem;
929 struct gcpro gcpro1, gcpro2; 929 struct gcpro gcpro1, gcpro2;
1028 1028
1029 Then the BODY is executed. 1029 Then the BODY is executed.
1030 Within BODY, (throw TAG) with same tag exits BODY and exits this `catch'. 1030 Within BODY, (throw TAG) with same tag exits BODY and exits this `catch'.
1031 If no throw happens, `catch' returns the value of the last BODY form. 1031 If no throw happens, `catch' returns the value of the last BODY form.
1032 If a throw happens, it specifies the value to return from `catch'. 1032 If a throw happens, it specifies the value to return from `catch'.
1033 usage: (catch TAG &rest BODY) */) 1033 usage: (catch TAG BODY...) */)
1034 (args) 1034 (args)
1035 Lisp_Object args; 1035 Lisp_Object args;
1036 { 1036 {
1037 register Lisp_Object tag; 1037 register Lisp_Object tag;
1038 struct gcpro gcpro1; 1038 struct gcpro gcpro1;
1157 DEFUN ("unwind-protect", Funwind_protect, Sunwind_protect, 1, UNEVALLED, 0, 1157 DEFUN ("unwind-protect", Funwind_protect, Sunwind_protect, 1, UNEVALLED, 0,
1158 doc: /* Do BODYFORM, protecting with UNWINDFORMS. 1158 doc: /* Do BODYFORM, protecting with UNWINDFORMS.
1159 If BODYFORM completes normally, its value is returned 1159 If BODYFORM completes normally, its value is returned
1160 after executing the UNWINDFORMS. 1160 after executing the UNWINDFORMS.
1161 If BODYFORM exits nonlocally, the UNWINDFORMS are executed anyway. 1161 If BODYFORM exits nonlocally, the UNWINDFORMS are executed anyway.
1162 usage: (unwind-protect BODYFORM &rest UNWINDFORMS) */) 1162 usage: (unwind-protect BODYFORM UNWINDFORMS...) */)
1163 (args) 1163 (args)
1164 Lisp_Object args; 1164 Lisp_Object args;
1165 { 1165 {
1166 Lisp_Object val; 1166 Lisp_Object val;
1167 int count = specpdl_ptr - specpdl; 1167 int count = specpdl_ptr - specpdl;
1197 with VAR bound to (SIGNALED-CONDITIONS . SIGNAL-DATA). 1197 with VAR bound to (SIGNALED-CONDITIONS . SIGNAL-DATA).
1198 VAR may be nil; then you do not get access to the signal information. 1198 VAR may be nil; then you do not get access to the signal information.
1199 1199
1200 The value of the last BODY form is returned from the condition-case. 1200 The value of the last BODY form is returned from the condition-case.
1201 See also the function `signal' for more info. 1201 See also the function `signal' for more info.
1202 usage: (condition-case VAR BODYFORM &rest HANDLERS) */) 1202 usage: (condition-case VAR BODYFORM HANDLERS...) */)
1203 (args) 1203 (args)
1204 Lisp_Object args; 1204 Lisp_Object args;
1205 { 1205 {
1206 Lisp_Object val; 1206 Lisp_Object val;
1207 struct catchtag c; 1207 struct catchtag c;