changeset 53197:61703d3393d6

Add macros `1value' and `noreturn'.
author Jonathan Yavner <jyavner@member.fsf.org>
date Sun, 30 Nov 2003 06:56:59 +0000
parents b3327f1ed9e1
children 5023ae2f95af
files lisp/subr.el
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sun Nov 30 06:56:28 2003 +0000
+++ b/lisp/subr.el	Sun Nov 30 06:56:59 2003 +0000
@@ -62,6 +62,20 @@
 
 (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