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

progn


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

Syntax

(progn [expr1 expr2 ... ])
exprN - expressions comprising the body of the loop
returns - the value of the last expression

Description

The 'progn' special form is basically a 'block' construct that contains a block of code [expressions] to evaluate. The value of the last expression 'exprN' will be returned as the result of 'progn'. If there are no 'exprs', NIL is returned.

Examples

(progn (print "hi") (print "ho"))  ; prints "hi" "ho"  returns "ho"
(progn)                            ; returns NIL
(progn "hey" (print "ho"))         ; prints "ho"  returns "ho"
(progn 'a)                         ; returns A
(progn 'a 'b 'c)                   ; returns C

Note: prog1 , prog2 , 'progn' and progv do not allow the use of return or go or tags for go.

See the progn special form in the XLISP 2.0 manual.

  Back to Top


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