#| I found this in Google Groups. I wanted to do a whole list of FAQ's & A's, but life intervenes, so I'll post this one now and do more later. |#
'(((:question "How do I do multiple statements in a row, in an IF? ;; Warning: Incorrect code! (if (test) ; then-part (statement1) (statement2) ; else-part (statement3) (statement4)) ") (:answer "In general, wherever you can put a single expression, you can put a PROGN with multiple expressions. So to solve this particular question, (if (test) (progn (statement1) (statement2)) (progn (statement3) (statement4))) You could also use COND, which has implicit PROGN's for each set of result statements: (cond ((test) (statement1) (statement2)) (t (statement3) (statement4))) Of course, COND also works with multiple tests. See the Hyperspec for PROGN and COND."))) #| -- Larry |# _______________________________________________ cl-faq mailing list cl-faq@lispniks.com http://www.lispniks.com/mailman/listinfo/cl-faq