cond
9.9
A piece of code that checks conditions and returns the first true result
- noun
- /kɒnd/
- Specialized
- You can use cond to simplify complex decision-making in your code.
Examples
-
What's presented to cond is a series of pairs.
-
Eve list apply con pair cond Lambda define.
-
Find eval pair, cond Lambda define.
-
In Lisp, the cond function allows programmers to evaluate multiple conditions in order.
-
When writing a Lisp program, remember to wrap your conditions in a cond expression.
Surface Forms
Etymology
Cond is short for conditional, and it comes from the idea of checking 'conditions' one by one. In programming a cond expression tests each condition in order and returns the result of the first one that is true.