commit 849cce01297c3f0c12d8e7c22a0e3da87aae42e7
parent 20217f1286781478293c21d1166de93ff3e37fcb
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Wed, 31 Jan 2024 14:09:26 -0500
Reflow.
Diffstat:
1 file changed, 55 insertions(+), 46 deletions(-)
diff --git a/doc/r7rs-small/r7rs-small.texinfo b/doc/r7rs-small/r7rs-small.texinfo
@@ -1285,10 +1285,11 @@ procedure like @code{set-car!} or @code{string-set!}.
syntax: (@svar{operator} @svar{operand@sub{1}} @dots{})
-A procedure call is written by enclosing in parentheses an expression for the procedure to
-be called followed by expressions for the arguments to be passed to it. The operator and
-operand expressions are evaluated (in an unspecified order) and the resulting procedure
-is passed the resulting arguments.
+A procedure call is written by enclosing in parentheses an expression for
+the procedure to be called followed by expressions for the arguments to be
+passed to it. The operator and operand expressions are evaluated (in an
+unspecified order) and the resulting procedure is passed the resulting
+arguments.
@example
@@ -1297,46 +1298,51 @@ is passed the resulting arguments.
@end example
-The procedures in this document are available as the values of
-variables exported by the standard libraries. For example, the addition and multiplication
-procedures in the above examples are the values of the variables @code{+} and @code{*} in the base
-library. New procedures are created by evaluating lambda expressions (@xref{Procedures}).
+The procedures in this document are available as the values of variables
+exported by the standard libraries. For example, the addition and
+multiplication procedures in the above examples are the values of the
+variables @code{+} and @code{*} in the base library. New procedures are
+created by evaluating lambda expressions (@xref{Procedures}).
-Procedure calls can return any number of values (see values in @ref{Control features}). Most of the
-procedures defined in this report return one value or, for procedures such as apply, pass
-on the values returned by a call to one of their arguments. Exceptions are noted in the
-individual descriptions.
+Procedure calls can return any number of values (see values in @ref{Control
+features}). Most of the procedures defined in this report return one value
+or, for procedures such as apply, pass on the values returned by a call to
+one of their arguments. Exceptions are noted in the individual descriptions.
-Note: In contrast to other dialects of Lisp, the order of evaluation is unspecified, and
-the operator expression and the operand expressions are always evaluated with the
-same evaluation rules.
+Note: In contrast to other dialects of Lisp, the order of evaluation is
+unspecified, and the operator expression and the operand expressions are
+always evaluated with the same evaluation rules.
-Note: Although the order of evaluation is otherwise unspecified, the effect of any
-concurrent evaluation of the operator and operand expressions is constrained to be
-consistent with some sequential order of evaluation. The order of evaluation may be
-chosen differently for each procedure call.
+Note: Although the order of evaluation is otherwise unspecified, the effect
+of any concurrent evaluation of the operator and operand expressions is
+constrained to be consistent with some sequential order of evaluation. The
+order of evaluation may be chosen differently for each procedure call.
-Note: In many dialects of Lisp, the empty list, @code{()}, is a legitimate expression evaluating
-to itself. In Scheme, it is an error.
+Note: In many dialects of Lisp, the empty list, @code{()}, is a legitimate
+expression evaluating to itself. In Scheme, it is an error.
@node Procedures
@subsection Procedures
@deffn syntax lambda @svar{formals} @svar{body}
-Syntax: @svar{Formals} is a formal arguments list as described below, and @svar{body} is a sequence
-of zero or more definitions followed by one or more expressions.
-
-Semantics: A @code{lambda} expression evaluates to a procedure. The environment in effect when
-the @code{lambda} expression was evaluated is remembered as part of the procedure. When the
-procedure is later called with some actual arguments, the environment in which the
-@code{lambda} expression was evaluated will be extended by binding the variables in the formal
-argument list to fresh locations, and the corresponding actual argument values will be
-stored in those locations. (A @dfn{fresh} location is one that is distinct from every previously
-existing location.) Next, the expressions in the body of the @code{lambda} expression (which, if it
-contains definitions, represents a @code{letrec*} form---@xref{Binding constructs}) will be evaluated
-sequentially in the extended environment. The results of the last expression in the body
-will be returned as the results of the procedure call.
+Syntax: @svar{Formals} is a formal arguments list as described below, and
+@svar{body} is a sequence of zero or more definitions followed by one or
+more expressions.
+
+Semantics: A @code{lambda} expression evaluates to a procedure. The
+environment in effect when the @code{lambda} expression was evaluated is
+remembered as part of the procedure. When the procedure is later called with
+some actual arguments, the environment in which the @code{lambda} expression
+was evaluated will be extended by binding the variables in the formal
+argument list to fresh locations, and the corresponding actual argument
+values will be stored in those locations. (A @dfn{fresh} location is one
+that is distinct from every previously existing location.) Next, the
+expressions in the body of the @code{lambda} expression (which, if it
+contains definitions, represents a @code{letrec*} form---@xref{Binding
+constructs}) will be evaluated sequentially in the extended environment. The
+results of the last expression in the body will be returned as the results
+of the procedure call.
@display
@code{((lambda (x) (+ x x))} @result{} a procedure
@@ -1359,22 +1365,25 @@ will be returned as the results of the procedure call.
@itemize
@item
-@code{(}@svar{variable@sub{1}} @dots{}@code{)}: The procedure takes a fixed number of arguments; when the
-procedure is called, the arguments will be stored in fresh locations that are bound to
-the corresponding variables.
+@code{(}@svar{variable@sub{1}} @dots{}@code{)}: The procedure takes a fixed
+number of arguments; when the procedure is called, the arguments will be
+stored in fresh locations that are bound to the corresponding variables.
@item
-@svar{variable}: The procedure takes any number of arguments; when the procedure is
-called, the sequence of actual arguments is converted into a newly allocated list, and
-the list is stored in a fresh location that is bound to @svar{variable}.
+@svar{variable}: The procedure takes any number of arguments; when the
+procedure is called, the sequence of actual arguments is converted into a
+newly allocated list, and the list is stored in a fresh location that is
+bound to @svar{variable}.
@item
-@code{(}@svar{variable@sub{1}} @dots{} @svar{variable@sub{n}} . @svar{variable@sub{n+1}}@code{)}: If a space-delimited period precedes the last
-variable, then the procedure takes @var{n} or more arguments, where @var{n} is the number of
-formal arguments before the period (it is an error if there is not at least one). The value
-stored in the binding of the last variable will be a newly allocated list of the actual
-arguments left over after all the other actual arguments have been matched up against
-the other formal arguments.
+@code{(}@svar{variable@sub{1}} @dots{} @svar{variable@sub{n}} .
+@svar{variable@sub{n+1}}@code{)}: If a space-delimited period precedes the
+last variable, then the procedure takes @var{n} or more arguments, where
+@var{n} is the number of formal arguments before the period (it is an error
+if there is not at least one). The value stored in the binding of the last
+variable will be a newly allocated list of the actual arguments left over
+after all the other actual arguments have been matched up against the other
+formal arguments.
@end itemize