r7rs-small-texinfo

Unnamed repository; edit this file 'description' to name the repository.
git clone https://kaka.farm/~git/r7rs-small-texinfo
Log | Files | Refs

commit 7bcc2eac5eca21a3e8ed66b4796612b40a8c9732
parent d169c2ec1b00afbf43bfbbf087e8c77011c2e1b8
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Tue,  6 Feb 2024 15:32:03 -0500

Derived expr. impls: Reflow paragraphs.

Diffstat:
Mdoc/r7rs-small/derived-expressions-implementation.texinfo | 55+++++++++++++++++++++++++++++++------------------------
1 file changed, 31 insertions(+), 24 deletions(-)

diff --git a/doc/r7rs-small/derived-expressions-implementation.texinfo b/doc/r7rs-small/derived-expressions-implementation.texinfo @@ -1,9 +1,10 @@ @node Derived expression types formal @section Derived expression types -This section gives syntax definitions for the derived expression types in -terms of the primitive expression types (literal, variable, call, @code{lambda}, -@code{if}, and @code{set!}), except for @code{quasiquote}. +This section gives syntax definitions for the derived expression +types in terms of the primitive expression types (literal, variable, +call, @code{lambda}, @code{if}, and @code{set!}), except for +@code{quasiquote}. Conditional derived syntax types: @@ -120,11 +121,13 @@ Binding constructs: body1 body2 ...))))) @end lisp -The following @code{letrec} macro uses the symbol @code{<undefined>} in place of an expression which -returns something that when stored in a location makes it an error to try to obtain the -value stored in the location. (No such expression is defined in Scheme.) A trick is used to -generate the temporary names needed to avoid specifying the order in which the values -are evaluated. This could also be accomplished by using an auxiliary macro. +The following @code{letrec} macro uses the symbol @code{<undefined>} +in place of an expression which returns something that when stored in +a location makes it an error to try to obtain the value stored in the +location. (No such expression is defined in Scheme.) A trick is used +to generate the temporary names needed to avoid specifying the order +in which the values are evaluated. This could also be accomplished +by using an auxiliary macro. @lisp (define-syntax letrec @@ -255,9 +258,10 @@ are evaluated. This could also be accomplished by using an auxiliary macro. ((lambda () exp ...))))) @end lisp -The following alternative expansion for @code{begin} does not make use of the ability to write -more than one expression in the body of a lambda expression. In any case, note that -these rules apply only if the body of the @code{begin} contains no definitions. +The following alternative expansion for @code{begin} does not make +use of the ability to write more than one expression in the body of +a lambda expression. In any case, note that these rules apply only +if the body of the @code{begin} contains no definitions. @lisp (define-syntax begin @@ -271,9 +275,10 @@ these rules apply only if the body of the @code{begin} contains no definitions. (begin exp2 ...)))))) @end lisp -The following syntax definition of do uses a trick to expand the variable clauses. As with -@code{letrec} above, an auxiliary macro would also work. The expression @code{(if #f #f)} is used to -obtain an unspecific value. +The following syntax definition of do uses a trick to expand the +variable clauses. As with @code{letrec} above, an auxiliary macro +would also work. The expression @code{(if #f #f)} is used to obtain +an unspecific value. @lisp (define-syntax do @@ -352,10 +357,10 @@ where @code{make-promise} is defined as follows: (list (cons done? proc)))) @end lisp -Finally, we define @code{force} to call the procedure expressions in -promises iteratively using a trampoline technique following SRFI 45 -until a non-lazy result (i.e.@: a value created by -@code{delay} instead of @code{delay-force}) is returned, as follows: +Finally, we define @code{force} to call the procedure expressions +in promises iteratively using a trampoline technique following SRFI +45 until a non-lazy result (i.e.@: a value created by @code{delay} +instead of @code{delay-force}) is returned, as follows: @c \cite{srfi45} @lisp @@ -383,8 +388,9 @@ with the following promise accessors: @end lisp The following implementation of @code{make-parameter} and -@code{parameterize} is suitable for an implementation with no threads. Parameter objects are -implemented here as procedures, using two arbitrary unique objects @svar{param-set!} and +@code{parameterize} is suitable for an implementation with no +threads. Parameter objects are implemented here as procedures, +using two arbitrary unique objects @svar{param-set!} and @svar{param-convert}: @lisp @@ -436,8 +442,8 @@ dynamically rebind the associated value: body)))) @end lisp -The following implementation of @code{guard} depends on an auxiliary macro, here called -@code{guard-aux}. +The following implementation of @code{guard} depends on an auxiliary +macro, here called @code{guard-aux}. @lisp (define-syntax guard @@ -524,8 +530,9 @@ The following implementation of @code{guard} depends on an auxiliary macro, here (cl (params body0 ...) ...))))))) @end lisp -This definition of @code{cond-expand} does not interact with the @code{features} procedure. It requires -that each feature identifier provided by the implementation be explicitly mentioned. +This definition of @code{cond-expand} does not interact with the +@code{features} procedure. It requires that each feature identifier +provided by the implementation be explicitly mentioned. @lisp (define-syntax cond-expand