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)
(setq symbol1 statement1 [symbol2 statement2] ...)
Programming Overview of LISP (LISt Processing) Language
Bricscad™ is commercialized by Bricsys NV. Bricsys NV and Vondle NV are fully owned subsidiaries of Menhirs NV. © 2001- Menhirs NV - All rights reserved. |