commit db5561253ee6fe95469c78c6a49cd1b0f1a3d42f
parent 28a58cf7d705a3b9122ff0b222317d6b51894a13
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Wed, 7 Feb 2024 15:21:34 -0500
Expressions: Indexing, part 1.
Diffstat:
3 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/doc/r7rs-small/derived/binding-constructs.texinfo b/doc/r7rs-small/derived/binding-constructs.texinfo
@@ -1,6 +1,8 @@
@node Binding constructs
@subsection Binding constructs
+@cindex region
+
The binding constructs @code{let}, @code{let*}, @code{letrec},
@code{letrec*}, @code{let-values}, and @code{let*-values} give Scheme a
block structure, like Algol 60. The syntax of the first four constructs is
@@ -28,6 +30,8 @@ zero or more definitions followed by a sequence of one or more expressions
as described in @ref{Expressions}. It is an error for a @svar{variable} to
appear more than once in the list of variables being bound.
+@cindex region
+
Semantics: The @svar{init}s are evaluated in the current environment (in
some unspecified order), the @svar{variable}s are bound to fresh locations
holding the results, the @svar{body} is evaluated in the extended
@@ -58,6 +62,8 @@ Syntax: @svar{Bindings} has the form
and @svar{body} is a sequence of zero or more definitions followed by
one or more expressions as described in @ref{Expressions}.
+@cindex region
+
Semantics: The @code{let*} binding construct is similar to @code{let}, but
the bindings are performed sequentially from left to right, and the region
of a binding indicated by @code{(}@svar{variable} @svar{init}@code{)} is
@@ -86,6 +92,8 @@ more expressions as described in @ref{Expressions}. It is an error for a
@svar{variable} to appear more than once in the list of variables being
bound.
+@cindex region
+
Semantics: The @svar{variable}s are bound to fresh locations holding
unspecified values, the @svar{init}s are evaluated in the resulting
environment (in some unspecified order), each @svar{variable} is assigned to
@@ -132,6 +140,8 @@ more expressions as described in @ref{Expressions}. It is an error for a
@svar{variable} to appear more than once in the list of variables being
bound.
+@cindex region
+
Semantics: The @svar{variable}s are bound to fresh locations, each
@svar{variable} is assigned in left-to-right order to the result of
evaluating the corresponding @svar{init} (interleaving evaluations and
@@ -185,6 +195,8 @@ where each @svar{init} is an expression, and @svar{body} is zero or more
definitions followed by a sequence of one or more expressions as described in @ref{Expressions}.
It is an error for a variable to appear more than once in the set of @svar{formals}.
+@cindex region
+
Semantics:
The @svar{init}s are evaluated in the current environment (in some
unspecified order) as if by invoking @code{call-with-values}, and the
@@ -218,6 +230,8 @@ and @svar{body} is a sequence of zero or more definitions followed by one or
more expressions as described in @ref{Expressions}. In each @svar{formals},
it is an error if any variable appears more than once.
+@cindex region
+
The @code{let*-values} construct is similar to @code{let-values}, but the
@svar{init}s are evaluated and bindings created sequentially from left to
right, with the region of the bindings of each @svar{formals} including the
diff --git a/doc/r7rs-small/derived/conditionals.texinfo b/doc/r7rs-small/derived/conditionals.texinfo
@@ -5,6 +5,8 @@
@deffnx {auxiliary syntax} else
@deffnx {auxiliary syntax} =>
+@cindex true
+
Syntax: @svar{Clauses} take one of two forms, either
@display
diff --git a/doc/r7rs-small/primitive-expressions.texinfo b/doc/r7rs-small/primitive-expressions.texinfo
@@ -14,6 +14,9 @@
@node Variable references
@subsection Variable references
+@cindex variable
+@cindex unbound
+
syntax: @svar{variable}
An expression consisting of a variable
@@ -84,6 +87,9 @@ procedure like @code{set-car!} or @code{string-set!}.
@node Procedure calls
@subsection Procedure calls
+@cindex call
+@cindex procedure call
+
syntax: (@svar{operator} @svar{operand@sub{1}} @dots{})
A procedure call is written by enclosing in parentheses an expression for
@@ -202,6 +208,8 @@ predicates}).
@node Conditionals primitive
@subsection Conditionals
+@cindex true
+
@deffn syntax if @svar{test} @svar{consequent} @svar{alternate}
@deffnx syntax if @svar{test} @svar{consequent}
@@ -226,6 +234,8 @@ of the expression is unspecified.
@node Assignments
@subsection Assignments
+@cindex region
+
@deffn syntax set! @svar{variable} @svar{expression}
Semantics: @svar{Expression} is evaluated, and the resulting value is stored