commit 24ed5465818ba9d7377dd80c0613419376124d8d
parent 7622bf6ec235cb83f9d910e99341adcead1cc12b
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Wed, 31 Jan 2024 17:08:07 -0500
Cond: Texify.
Diffstat:
1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/doc/r7rs-small/r7rs-small.texinfo b/doc/r7rs-small/r7rs-small.texinfo
@@ -1474,8 +1474,8 @@ other directories to search.
@node Derived expression types
@section Derived expression types
-The constructs in this section are hygienic, as discussed in section 4.3. For reference
-purposes, section 7.3 gives syntax definitions that will convert most of the constructs
+The constructs in this section are hygienic, as discussed in @ref{Macros}. For reference
+purposes, @ref{Derived expression types formal} gives syntax definitions that will convert most of the constructs
described in this section into the primitive constructs described in the previous section.
@menu
@@ -1493,31 +1493,44 @@ described in this section into the primitive constructs described in the previou
@node Conditionals cond
@subsection Conditionals (cond)
-syntax: (cond @svar{clause1} @svar{clause2} @dots{})
-auxiliary syntax: else
-auxiliary syntax: =>
+@deffn syntax cond @svar{clause@sub{1}} @svar{clause@sub{2}}@dots{}
+@deffnx {auxiliary syntax} else
+@deffnx {auxiliary syntax} =>
Syntax: @svar{Clauses} take one of two forms, either
-(@svar{test} @svar{expression1} @dots{})where @svar{test} is any expression, or (@svar{test} => @svar{expression})The
-last @svar{clause} can be an ``else clause,'' which has the form (else @svar{expression1}
-@svar{expression2} @dots{}).
+@display
+@code{(}@svar{test} @svar{expression@sub{1}} @dots{}@code{)}
+@end display
+
+where @svar{test} is any expression, or
+
+@display
+@code{(}@svar{test}@code{ => }@svar{expression}@code{)}
+@end display
-Semantics: A 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(see section 6.3).
+The last @svar{clause} can be an ``else clause,'' which has the form
+
+@display
+@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.
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 => alternate form,
+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 cond expression.
+values returned by this procedure are returned by the @code{cond} expression.
-If all @svar{test}s evaluate to #f, and there is no else clause, then the result of the conditional
+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