Debian Codegraph @

docsrc/xlisp/xlisp-doc/reference/tagbody.htm

raw
1 <html><head><title>XLISP tagbody</title>
2
3 <link rel="stylesheet" type="text/css" href="reference.css">
4
5 </head>
6
7 <body>
8
9 <a href="../start.htm">Nyquist / XLISP 2.0</a>&nbsp; -&nbsp;
10 <a href="../manual/contents.htm">Contents</a> |
11 <a href="../tutorials/tutorials.htm">Tutorials</a> |
12 <a href="../examples/examples.htm">Examples</a> |
13 <a href="reference-index.htm">Reference</a>
14
15 <hr>
16
17 <h1>tagbody</h1>
18
19 <hr>
20
21 <p><table cellpadding="0" cellspacing="0" style="margin-left:10px"><tbody>
22 <tr valign="top">
23 <td><nobr>Type:</nobr></td>
24 <td><nobr>&nbsp;&nbsp;-&nbsp;&nbsp;</nobr></td>
25 <td width="100%"><nobr>special form (fsubr)</nobr></td>
26 </tr>
27 <tr valign="top">
28 <td><nobr>Source:</nobr></td>
29 <td><nobr>&nbsp;&nbsp;-&nbsp;&nbsp;</nobr></td>
30 <td width="100%"><nobr>xlcont.c</nobr></td>
31 </tr>
32 </tbody></table></p>
33
34 <h2>Syntax</h2>
35
36 <dl>
37 <dt>(tagbody [<i>expr</i> ... ])</dt>
38 <dd><i>expr</i> - expressions comprising the body of the block which may
39 contain <a href="go.htm">go</a>s or tags for
40 <a href="go.htm">go</a><br>
41 returns - <a href="nil.htm">NIL</a></dd>
42 </dl>
43
44 <h2>Description</h2>
45
46 <p>The 'tagbody' special form is basically a 'block' construct that contains
47 a block of code [expressions] to evaluate. After the execution of the
48 'tagbody' 'exprs', <a href="nil.htm">NIL</a> is returned. The
49 'tagbody' special form allows 'go-to' style branching within the 'block'
50 construct via the <a href="go.htm">go</a> special form. To allow
51 this, each 'expr' may be a tag or a form. The tag-symbol is the 'label' and
52 must exist somewhere within the 'block' that the <a
53 href="go.htm">go</a> occurs within.</p>
54
55 <h2>Examples</h2>
56
57 <pre class="example">
58 (tagbody <font color="#008844">; build the 'block'</font>
59 start (print "begin") <font color="#008844">; tag - start</font>
60 (GO end)
61 (print "hello") <font color="#008844">; won't ever be reached</font>
62 end (print "done")) <font color="#008844">; tag - END</font>
63 <font color="#008844">; prints "begin" "done"</font>
64 <font color="#008844">; returns NIL</font>
65 </pre>
66
67 <p>See the
68 <a href="../manual/xlisp-man-021.htm#tagbody">tagbody</a>
69 special form in the <nobr>XLISP 2.0</nobr> manual.</p>
70
71 <p><nobr>&nbsp;&nbsp;<a href="#top">Back to Top</nobr></a></p>
72
73 <hr>
74
75 <a href="../start.htm">Nyquist / XLISP 2.0</a>&nbsp; -&nbsp;
76 <a href="../manual/contents.htm">Contents</a> |
77 <a href="../tutorials/tutorials.htm">Tutorials</a> |
78 <a href="../examples/examples.htm">Examples</a> |
79 <a href="reference-index.htm">Reference</a>
80
81 </body></html>