1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
<html>
<head><title>PROGN.html -- ACL2 Version 3.1</title></head>
<body text=#000000 bgcolor="#FFFFFF">
<h2>PROGN</h2>evaluate some <a href="EVENTS.html">events</a>
<pre>Major Section: <a href="EVENTS.html">EVENTS</a>
</pre><p>
<pre>
Example Form:
(progn (defun foo (x) x)
(defmacro my-defun (&rest args)
(cons 'defun args))
(my-defun bar (x) (foo x)))<p>
General form:
(progn event1 event2 ... eventk)
</pre>
where <code>k</code> >= 0 and each <code>eventi</code> is a legal embedded event form
(see <a href="EMBEDDED-EVENT-FORM.html">embedded-event-form</a>). These events are evaluated in sequence. A
utility is provided to assist in debugging failures of such execution;
see <a href="REDO-FLAT.html">redo-flat</a>.<p>
NOTE: If the <code>eventi</code> above are not all legal embedded event forms
(see <a href="EMBEDDED-EVENT-FORM.html">embedded-event-form</a>), consider using <code><a href="ER-PROGN.html">er-progn</a></code> or (with great
care!) <code><a href="PROGN_bang_.html">progn!</a></code> instead.<p>
For a related event form that does allows introduction of <a href="CONSTRAINT.html">constraint</a>s
and <code><a href="LOCAL.html">local</a></code> <a href="EVENTS.html">events</a>, see <a href="ENCAPSULATE.html">encapsulate</a>.<p>
ACL2 does not allow the use of <code>progn</code> in definitions. Instead, the
macro <code><a href="ER-PROGN.html">er-progn</a></code> can be used for sequencing <a href="STATE.html">state</a>-oriented
operations; see <a href="ER-PROGN.html">er-progn</a> and see <a href="STATE.html">state</a>. If you are using single-threaded
objects (see <a href="STOBJ.html">stobj</a>) you may wish to define a version of <code><a href="ER-PROGN.html">er-progn</a></code> that
cascades the object through successive changes. ACL2's <code><a href="PPROGN.html">pprogn</a></code> is the
<code>state</code> analogue of such a macro.<p>
If your goal is simply to execute a sequence of top-level forms, for example
a sequence of definitions, consider using <code>ld</code> instead; see <a href="LD.html">ld</a>.
<p>
<br><br><br><a href="acl2-doc.html"><img src="llogo.gif"></a> <a href="acl2-doc-index.html"><img src="index.gif"></a>
</body>
</html>
|