cond
(cond
(EXPRESSION EXPRESSION) (EXPRESSION EXPRESSION) ...)
A cond
form contains one or more branches, or "lines". Each line contains two expressions: a question expression and an answer expresson. The lines are considered in order. To evaluate a line, first evaluate the question expression. If the result is true, then the result of the whole cond
is the result of evaluating the answer expression of the line. If the result of evaluating the answer expression is false, the line is discarded and evaluation proceeds with the next line. If the result of the test expression is neither true nor false, it is an error. If none of the test expressions evaluates to true, it is also an error. (cond
(EXPRESSION EXPRESSION) ... (else
EXPRESSION))
This form of cond
is similar to the prior one except that the final else
clause is always taken if no prior line's test expression evaluates to true. In other words, there is no possibility that evaluation will "fall off the end" of the cond
expression.
Intermediate Student with Lambda Language