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 1fbe2de5322020557c52b39c122d2b79705f7b8b
parent 86aaa15c49769f2edbf1fdf1ad9f22573cec2f88
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Thu,  1 Feb 2024 13:07:30 -0500

Dynamic binding: Texify (further).

Diffstat:
Mdoc/r7rs-small/r7rs-small.texinfo | 66+++++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 37 insertions(+), 29 deletions(-)

diff --git a/doc/r7rs-small/r7rs-small.texinfo b/doc/r7rs-small/r7rs-small.texinfo @@ -2262,34 +2262,40 @@ parameterize, which is described below. The effect of passing arguments to a parameter object is implementation-dependent. @end deffn -syntax: (parameterize ((@svar{param1} @svar{value1}) @dots{}) - @svar{body}) +@deffn syntax parameterize (@svar{param@sub{1}} @svar{value@sub{1}})@dots{} @svar{body} -Syntax: Both @svar{param1} and @svar{value1} are expressions. +Syntax: Both @svar{param@sub{1}} and @svar{value@sub{1}} are expressions. It is an error if the value of any @svar{param} expression is not a parameter object. -Semantics: A parameterize expression is used to change the values returned by specified -parameter objects during the evaluation of the body. - -The @svar{param} and @svar{value} expressions are evaluated in an unspecified order. The @svar{body} -is evaluated in a dynamic environment in which calls to the parameters return the results -of passing the corresponding values to the conversion procedure specified when the -parameters were created. Then the previous values of the parameters are restored -without passing them to the conversion procedure. The results of the last expression in -the @svar{body} are returned as the results of the entire parameterize expression. - -Note: If the conversion procedure is not idempotent, the results of (parameterize ((x -(x))) ...), which appears to bind the parameter - -x to its current value, might not be what the user expects. - -If an implementation supports multiple threads of execution, then parameterize must not -change the associated values of any parameters in any thread other than the current -thread and threads created inside @svar{body}. - -Parameter objects can be used to specify configurable settings for a computation -without the need to pass the value to every procedure in the call chain explicitly. +Semantics: +A @code{parameterize} expression is used to change the values returned by +specified parameter objects during the evaluation of the body. + +The @svar{param} and @svar{value} expressions +are evaluated in an unspecified order. The @svar{body} is +evaluated in a dynamic environment in which calls to the +parameters return the results of passing the corresponding values +to the conversion procedure specified when the parameters were created. +Then the previous values of the parameters are restored without passing +them to the conversion procedure. +The results of the last +expression in the @svar{body} are returned as the results of the entire +@code{parameterize} expression. + +Note: If the conversion procedure is not idempotent, the results of +@code{(parameterize ((x (x))) @dots{})}, +which appears to bind the parameter @var{x} to its current value, +might not be what the user expects. + +If an implementation supports multiple threads of execution, then +@code{parameterize} must not change the associated values of any parameters +in any thread other than the current thread and threads created +inside @svar{body}. + +Parameter objects can be used to specify configurable settings for a +computation without the need to pass the value to every +procedure in the call chain explicitly. @example (define radix @@ -2302,17 +2308,19 @@ without the need to pass the value to every procedure in the call chain explicit (define (f n) (number->string n (radix))) -(f 12) @result{} "12" +(f 12) @result{} "12" (parameterize ((radix 2)) - (f 12)) @result{} "1100" -(f 12) @result{} "12" + (f 12)) @result{} "1100" +(f 12) @result{} "12" -(radix 16) @result{} unspecified +(radix 16) @result{} @r{unspecified} (parameterize ((radix 0)) - (f 12)) @result{} error + (f 12)) @error{} @end example +@end deffn + @node Exception handling @subsection Exception handling