XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

tagbody


Type:   -   special form (fsubr)
Source:   -   xlcont.c

Syntax

(tagbody [expr ... ])
expr - expressions comprising the body of the block which may contain gos or tags for go
returns - NIL

Description

The 'tagbody' special form is basically a 'block' construct that contains a block of code [expressions] to evaluate. After the execution of the 'tagbody' 'exprs', NIL is returned. The 'tagbody' special form allows 'go-to' style branching within the 'block' construct via the go special form. To allow this, each 'expr' may be a tag or a form. The tag-symbol is the 'label' and must exist somewhere within the 'block' that the go occurs within.

Examples

(tagbody                   ; build the 'block'
   start (print "begin")   ; tag - start
         (GO end)
         (print "hello")   ; won't ever be reached
   end   (print "done"))   ; tag - END
                           ; prints  "begin" "done"
                           ; returns NIL

See the tagbody special form in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next