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.

block

block

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

SYNTAX

(block  <name> [ <body> ... ] )
        <name>          -       an unevaluated symbol for the block name
        <body>          -       a series of expressions

DESCRIPTION

The BLOCK special form specifies a 'named-block' construct. The last expression in <body> will be returned by the BLOCK construct as its result unless a RETURN or RETURN-FROM is executed within BLOCK. The RETURN exit will exit the nearest (inner-most) BLOCK. The RETURN-FROM exit will exit the specified block.

EXAMPLES

(block out                              ; outer BLOCK
   (print "outer")                      ; 
   (block in                            ; inner BLOCK
        (print "inner")                 ;
        (return-from out "all done")    ;
        (print "won't get here")        ;
   )                                    ;
)                                       ; prints "outer"
                                        ; prints "inner"
                                        ; returns "all done"


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