comparison lisp/subr.el @ 53197:61703d3393d6

Add macros `1value' and `noreturn'.
author Jonathan Yavner <jyavner@member.fsf.org>
date Sun, 30 Nov 2003 06:56:59 +0000
parents 8337e648c2b3
children 6dab9150c9e0
comparison
equal deleted inserted replaced
53196:b3327f1ed9e1 53197:61703d3393d6
59 59
60 60
61 ;;;; Lisp language features. 61 ;;;; Lisp language features.
62 62
63 (defalias 'not 'null) 63 (defalias 'not 'null)
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)
64 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
68 self-quoting; the result of evaluating the lambda expression is the 82 self-quoting; the result of evaluating the lambda expression is the