]> git.eshelyaron.com Git - emacs.git/commitdiff
Add macros `1value' and `noreturn'.
authorJonathan Yavner <jyavner@member.fsf.org>
Sun, 30 Nov 2003 06:56:59 +0000 (06:56 +0000)
committerJonathan Yavner <jyavner@member.fsf.org>
Sun, 30 Nov 2003 06:56:59 +0000 (06:56 +0000)
lisp/subr.el

index dba7331f98c210244f0d0434a7e3d9acf1223d24..2996f2903e0b80fbae6947fc50e6936ebad2a645 100644 (file)
@@ -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