For each of specified condition-operators pairs function checks its condition and, if true, executes its operators. Condition and its operators are presented in list, where condition is its first element, and operators – are the rest ones. If one of the specified conditions is true, then result of its operators execution will be returned as function result.
Condition is true, if its evaluation using EVAL function is:
• Number. Number is considered to be true, if it is not equal to zero.
• String. String is considered to be true, if it is not empty.
• List. List is considered to be true, if it is not empty.
If all conditions are false, then no operators will be executed, and so function result is not defined.
Example:
(
COND ( ( > a 3) (PRINT a) (PRINT “ is greater than 3\n”) )
( ( > b a) (PRINT b) (PRINT “ is greather than ”) (PRINT a) (PRINT “ and a <= 3\n”))
)