
CONTROL CONSTRUCTS
EVALUATE CONDITIONALLY
(cond <pair>...)
fsubr
where
- <pred> is a predicate expression
- <expr> evaluated if the predicate is not NIL
returns the value of the first expression whose predicate is not NIL
THE LOGICAL AND OF A LIST OF EXPRESSIONS
(and <expr>...)
fsubr
THE LOGICAL OR OF A LIST OF EXPRESSIONS
(or <expr>...)
fsubr
EVALUATE EXPRESSIONS CONDITIONALLY
(if <texpr> <expr1> [<expr2>])
fsubr
EVALUATE ONLY WHEN A CONDITION IS TRUE
(when <texpr> <expr>...)
fsubr
EVALUATE ONLY WHEN A CONDITION IS FALSE
(unless <texpr> <expr>...)
fsubr
SELECT BY CASE
(case <expr> <case>...[(t <expr>)])
fsubr
where:
- <value> is a single expression or a list of expressions (unevaluated)
- <expr> are expressions to execute if the case matches
(t <expr>) default case (no previous matching)
returns the value of the last expression of the matching case
CREATE LOCAL BINDINGS
(let (<binding>...) <expr>...)
(let* (<binding>...) <expr>...)
fsubr
CREATE LOCAL FUNCTIONS
(flet (<binding>...) <expr>...)
(labels (<binding>...) <expr>...)
(macrolet (<binding>...) <expr>...)
fsubr
where:
- <sym> the function/macro name
- <fargs> formal argument list (lambda list)
- <expr> expressions constituting the body of the function/macro
<expr> the expressions to be evaluated
returns the value of the last expression
EVALUATE EXPRESSIONS AND CATCH THROWS
(catch <sym> <expr>...)
fsubr
THROW TO A CATCH
(throw <sym> [<expr>])
fsubr
PROTECT EVALUATION OF AN EXPRESSION
(unwind-protect <expr> <cexpr>...)
fsubr
Note: unwind-protect guarantees to execute the cleanup expressions even if a non-local exit terminates the evaluation of the protected expression
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker