From 1116910a519ba0e4ff84b9a83ff5207aa4fe5a24 Mon Sep 17 00:00:00 2001 From: Jonathan Yavner Date: Sun, 30 Nov 2003 06:56:59 +0000 Subject: [PATCH] Add macros `1value' and `noreturn'. --- lisp/subr.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- 2.39.2