From: Jonathan Yavner Date: Sun, 30 Nov 2003 06:56:59 +0000 (+0000) Subject: Add macros `1value' and `noreturn'. X-Git-Tag: ttn-vms-21-2-B4~8243 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1116910a519ba0e4ff84b9a83ff5207aa4fe5a24;p=emacs.git Add macros `1value' and `noreturn'. --- 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." (defalias 'not 'null) +(defmacro noreturn (form) + "Evaluates FORM, with the expectation that the evaluation will signal an error +instead of returning to its caller. If FORM does return, an error is +signalled." + `(prog1 ,form + (error "Form marked with `noreturn' did return"))) + +(defmacro 1value (form) + "Evaluates FORM, with the expectation that all the same value will be returned +from all evaluations of FORM. This is the global do-nothing +version of `1value'. There is also `testcover-1value' that +complains if FORM ever does return differing values." + form) + (defmacro lambda (&rest cdr) "Return a lambda expression. A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is