if -- r7rs Definition syntax;
Syntax keywords:
condition: expression;then-expression: expression;else-expression: expression;Syntax variants:
(_ condition then-expression)(_ condition then-expression else-expression)scheme:base -- (scheme base);scheme -- (scheme);(if <test> <consequent> <alternate>) (if <test> <consequent>)Syntax:
<Test>,<consequent>, and<alternate>are expressions.Semantics: An
ifexpression is evaluated as follows: first,<test>is evaluated. If it yields a true value (see section on booleans), then<consequent>is evaluated and its values are returned. Otherwise<alternate>is evaluated and its values are returned. If<test>yields a false value and no<alternate>is specified, then the result of the expression is unspecified.(if (> 3 2) 'yes 'no) ===> yes (if (> 2 3) 'yes 'no) ===> no (if (> 3 2) (- 3 2) (+ 3 2)) ===> 1
The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.