The 'prog2' special form is basically a 'block' construct that contains a block of code [expressions] to evaluate. The value of the second expression 'expr2' will be returned as the result of 'prog2'. If there is no 'expr2', 'expr1' is returned. If there is no 'expr1', NIL is returned.
(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:
See the
prog2
special form in the