type: special form (fsubr) location: built-in source file: xlcont.c Common LISP compatible: yes supported on: all machines
(prog1 [ <expr1> <expr2> ... ] ) <exprN> - expressions comprising the body of the loop
The PROG1 special form is basically a 'block' construct (like a PASCAL BEGIN / END) that contains a block of code (expressions) to evaluate. <expr1>'s value will be returned as the result of PROG1. If there is no <expr1>, NIL is returned.
(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.