[ << Scheme tutorial ] | [Top][Contents][Index] | [ Interfaces for programmers >> ] |
[ < if ] | [ Up : Scheme conditionals ] | [ Scheme in LilyPond > ] |
cond
Another conditional procedure in Scheme is cond
:
(cond (test-expression-1 result-expression-sequence-1) (test-expression-2 result-expression-sequence-2) … (test-expression-n result-expression-sequence-n))
For example:
guile> (define a 6) guile> (define b 8) guile> (cond ((< a b) "a is less than b") ... ((= a b) "a equals b") ... ((> a b) "a is greater than b")) "a is less than b"