(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...
(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)