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.

prog2

prog2

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

SYNTAX

(prog2  [ <expr1>  <expr2> ... ]  )
        <exprN>         -       expressions comprising the body of the loop

DESCRIPTION

The PROG2 special form is basically a 'block' construct (like a PASCAL BEGIN / END) that contains a block of code (expressions) to evaluate. <expr2>'s value will be returned as the result of PROG2. If there is no <expr2>, <expr1> is returned. If there is no <expr1>, NIL is returned.

EXAMPLES

(prog2 (print "hi") (print "ho"))       ; prints "hi" "ho" returns "ho"
(prog2)                                 ; returns NIL
(prog2 (print "hi"))                    ; prints "hi"      returns "hi"
(prog2 (print "ho") "hey")              ; prints "ho"      returns "hey"
(prog2 'a 'b 'c)                        ; returns B

NOTE: PROG1, PROG2, PROGN and PROGV do not allow the use of RETURN or GO or tags for GO.


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