1
|
<html><head><title>cond</title><h1>cond</h1></head><body><ul><li><code class="scheme">(<code class="scheme"><span class="keyword">cond</span></code> (<b>EXPRESSION</b> <b>EXPRESSION</b>) (<b>EXPRESSION</b> <b>EXPRESSION</b>) ...)</code><br /> A <code class="scheme"><span class="keyword">cond</span></code> form contains one or more branches, or "lines". Each line contains two expressions: a question expression and an answer expression. 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 <code class="scheme"><span class="keyword">cond</span></code> 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. </li><li><code class="scheme">(<code class="scheme"><span class="keyword">cond</span></code> (<b>EXPRESSION</b> <b>EXPRESSION</b>) ... (<code class="scheme"><span class="keyword">else</span></code> <b>EXPRESSION</b>))</code><br /> This form of <code class="scheme"><span class="keyword">cond</span></code> is similar to the prior one except that the final <code class="scheme"><span class="keyword">else</span></code> 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 <code class="scheme"><span class="keyword">cond</span></code> expression. </li></ul><p><a href="index.htm">Intermediate Student with Lambda Language</a></p></body></html>
|