(progn statement1 statement2 ...)


Evaluate the statement.


This function evaluates all the statements and returns the value of the last statement.

Generally, the progn function works in conjunction with the if function, since the if function is limited to a single if and then statement. Each if function can have only one then statement and an else statement. The progn allows you to have multiple statements evaluated. The value of the last statement is returned.

Example

Code Returns
(setq a 9)
(if (>= a 8)
(progn (setq b a)
(setq (1+ b)
)
)





10

Tell me about...

(apply function list)

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language