diff options
| author | Jonathan Yavner | 2003-11-30 06:56:59 +0000 |
|---|---|---|
| committer | Jonathan Yavner | 2003-11-30 06:56:59 +0000 |
| commit | 1116910a519ba0e4ff84b9a83ff5207aa4fe5a24 (patch) | |
| tree | f46689c4d03138b587a3ff6b01a1f2cd655de53f | |
| parent | bbaa142972a148a3a6cc68c2a8aaf973aaf2135f (diff) | |
| download | emacs-1116910a519ba0e4ff84b9a83ff5207aa4fe5a24.tar.gz emacs-1116910a519ba0e4ff84b9a83ff5207aa4fe5a24.zip | |
Add macros `1value' and `noreturn'.
| -rw-r--r-- | lisp/subr.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index dba7331f98c..2996f2903e0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -62,6 +62,20 @@ The return value of this function is not used." | |||
| 62 | 62 | ||
| 63 | (defalias 'not 'null) | 63 | (defalias 'not 'null) |
| 64 | 64 | ||
| 65 | (defmacro noreturn (form) | ||
| 66 | "Evaluates FORM, with the expectation that the evaluation will signal an error | ||
| 67 | instead of returning to its caller. If FORM does return, an error is | ||
| 68 | signalled." | ||
| 69 | `(prog1 ,form | ||
| 70 | (error "Form marked with `noreturn' did return"))) | ||
| 71 | |||
| 72 | (defmacro 1value (form) | ||
| 73 | "Evaluates FORM, with the expectation that all the same value will be returned | ||
| 74 | from all evaluations of FORM. This is the global do-nothing | ||
| 75 | version of `1value'. There is also `testcover-1value' that | ||
| 76 | complains if FORM ever does return differing values." | ||
| 77 | form) | ||
| 78 | |||
| 65 | (defmacro lambda (&rest cdr) | 79 | (defmacro lambda (&rest cdr) |
| 66 | "Return a lambda expression. | 80 | "Return a lambda expression. |
| 67 | A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is | 81 | A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is |