commit 89858a3fd93eb08a3d61c93a5e8d50dbd9b5c9cc
parent 24ed5465818ba9d7377dd80c0613419376124d8d
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Wed, 31 Jan 2024 17:09:15 -0500
Reflow & adjust example indentation.
Diffstat:
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/doc/r7rs-small/r7rs-small.texinfo b/doc/r7rs-small/r7rs-small.texinfo
@@ -1515,34 +1515,39 @@ The last @svar{clause} can be an ``else clause,'' which has the form
@code{(else }@svar{expression@sub{1}} @svar{expression@sub{2}} @dots{}@code{)}.
@end display
-Semantics: A @code{cond} expression is evaluated by evaluating the @svar{test} expressions of
-successive @svar{clause}s in order until one of them evaluates to a true value (@xref{Booleans).
-When a @svar{test} evaluates to a true value, the remaining @svar{expression}s in its @svar{clause} are
-evaluated in order, and the results of the last @svar{expression} in the @svar{clause} are returned
-as the results of the entire cond expression.
+Semantics: A @code{cond} expression is evaluated by evaluating the
+@svar{test} expressions of successive @svar{clause}s in order until one of
+them evaluates to a true value (@xref{Booleans). When a @svar{test}
+evaluates to a true value, the remaining @svar{expression}s in its
+@svar{clause} are evaluated in order, and the results of the last
+@svar{expression} in the @svar{clause} are returned as the results of the
+entire cond expression.
-If the selected @svar{clause} contains only the @svar{test} and no @svar{expression}s, then the value of
-the @svar{test} is returned as the result. If the selected @svar{clause} uses the @code{=>} alternate form,
-then the @svar{expression} is evaluated. It is an error if its value is not a procedure that
-accepts one argument. This procedure is then called on the value of the @svar{test} and the
-values returned by this procedure are returned by the @code{cond} expression.
+If the selected @svar{clause} contains only the @svar{test} and no
+@svar{expression}s, then the value of the @svar{test} is returned as the
+result. If the selected @svar{clause} uses the @code{=>} alternate form,
+then the @svar{expression} is evaluated. It is an error if its value is not
+a procedure that accepts one argument. This procedure is then called on the
+value of the @svar{test} and the values returned by this procedure are
+returned by the @code{cond} expression.
-If all @svar{test}s evaluate to @code{#f}, and there is no else clause, then the result of the conditional
-expression is unspecified; if there is an else clause, then its @svar{expression}s are evaluated in
-order, and the values of the last one are returned.
+If all @svar{test}s evaluate to @code{#f}, and there is no else clause, then
+the result of the conditional expression is unspecified; if there is an else
+clause, then its @svar{expression}s are evaluated in order, and the values
+of the last one are returned.
@end deffn
@example
(cond ((> 3 2) 'greater)
- ((< 3 2) 'less)) @result{} greater
+ ((< 3 2) 'less)) @result{} greater
(cond ((> 3 3) 'greater)
((< 3 3) 'less)
- (else 'equal)) @result{} equal
+ (else 'equal)) @result{} equal
(cond ((assv 'b '((a 1) (b 2))) => cadr)
- (else #f)) @result{} 2
+ (else #f)) @result{} 2
@end example