[ << Scheme tutorial ] | [Top][Contents][Index] | [ Interfaces for programmers >> ] |
[ < Scheme conditionals ] | [ Up : Scheme conditionals ] | [ cond > ] |
if
Scheme has an if
procedure:
(if test-expression true-expression false-expression)
test-expression is an expression that returns a boolean
value. If test-expression returns #t
, the if
procedure returns the value of true-expression, otherwise
it returns the value of false-expression.
guile> (define a 3) guile> (define b 5) guile> (if (> a b) "a is greater than b" "a is not greater than b") "a is not greater than b"