Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

tagbody

tagbody

type: special form (fsubr)
location: built-in
source file: xlcont.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(tagbody  [ <expr> ... ]  )
        <expr>          -       expressions comprising the body of the block
                                which may contain GOs or tags for GO  

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 <expr>'s, 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


Go to the first, previous, next, last section, table of contents.