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

prog1


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

Syntax

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

Description

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

Examples

(prog1 (print "hi") (print "ho"))  ; prints "hi" "ho"  returns "hi"
(prog1)                            ; returns NIL
(prog1 'a)                         ; returns A
(prog1 "hey" (print "ho"))         ; prints "ho"  returns "hey"

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

See the prog1 special form in the XLISP 2.0 manual.

  Back to Top


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