commit 6197607b94b5994a1d393f2094fc77b188385d8c
parent 551be470fd8197963ec57c10a1baae49d184769d
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Mon, 29 Jan 2024 18:49:51 -0500
Delete indent for Note & Rationale paragraphs.
Diffstat:
1 file changed, 143 insertions(+), 143 deletions(-)
diff --git a/doc/r7rs-small/r7rs-small.texinfo b/doc/r7rs-small/r7rs-small.texinfo
@@ -75,10 +75,10 @@ Appendix B provides a list of optional but standardized implementation feature n
The report concludes with a list of references and an alphabetic index.
- Note: The editors of the R5RS and R6RS reports are listed as authors of this report in
- recognition of the substantial portions of this report that are copied directly from
- R5RS and R6RS. There is no intended implication that those editors, individually or
- collectively, support or do not support this report.
+Note: The editors of the R5RS and R6RS reports are listed as authors of this report in
+recognition of the substantial portions of this report that are copied directly from
+R5RS and R6RS. There is no intended implication that those editors, individually or
+collectively, support or do not support this report.
@menu
* Introduction::
@@ -987,10 +987,10 @@ These locations are to be understood as conceptual, not physical. Hence, they do
necessarily correspond to memory addresses, and even if they do, the memory address
might not be constant.
- Rationale: In many systems it is desirable for constants(i.e. the values of literal
- expressions) to reside in read-only memory. Making it an error to alter constants
- permits this implementation strategy, while not requiring other systems to
- distinguish between mutable and immutable objects.
+Rationale: In many systems it is desirable for constants(i.e. the values of literal
+expressions) to reside in read-only memory. Making it an error to alter constants
+permits this implementation strategy, while not requiring other systems to
+distinguish between mutable and immutable objects.
@node Proper tail recursion
@section Proper tail recursion
@@ -1004,22 +1004,22 @@ call-with-current-continuation that are later invoked. In the absence of capture
continuations, calls could return at most once and the active calls would be those that had
not yet returned. A formal definition of proper tail recursion can be found in [6].
- Rationale: Intuitively, no space is needed for an active tail call because the
- continuation that is used in the tail call has the same semantics as the continuation
- passed to the procedure containing the call. Although an improper implementation
- might use a new continuation in the call, a return to this new continuation would be
- followed immediately by a return to the continuation passed to the procedure. A
- properly tail-recursive implementation returns to that continuation directly.
+Rationale: Intuitively, no space is needed for an active tail call because the
+continuation that is used in the tail call has the same semantics as the continuation
+passed to the procedure containing the call. Although an improper implementation
+might use a new continuation in the call, a return to this new continuation would be
+followed immediately by a return to the continuation passed to the procedure. A
+properly tail-recursive implementation returns to that continuation directly.
- Proper tail recursion was one of the central ideas in Steele and Sussman's original
- version of Scheme. Their first Scheme interpreter implemented both functions and
- actors. Control flow was expressed using actors, which differed from functions in
- that they passed their results on to another actor instead of returning to a caller. In
- the terminology of this section, each actor finished with a tail call to another actor.
+Proper tail recursion was one of the central ideas in Steele and Sussman's original
+version of Scheme. Their first Scheme interpreter implemented both functions and
+actors. Control flow was expressed using actors, which differed from functions in
+that they passed their results on to another actor instead of returning to a caller. In
+the terminology of this section, each actor finished with a tail call to another actor.
- Steele and Sussman later observed that in their interpreter the code for dealing with
- actors was identical to that for functions and thus there was no need to include both
- in the language.
+Steele and Sussman later observed that in their interpreter the code for dealing with
+actors was identical to that for functions and thus there was no need to include both
+in the language.
A tail callis a procedure call that occurs in a tail context. Tail contexts are defined
inductively. Note that a tail context is always determined with respect to a particular
@@ -1109,11 +1109,11 @@ calls. The reference to x is in a tail context, but it is not a call and thus is
@end example
- Note: Implementations may recognize that some non-tail calls, such as the call to h
- above, can be evaluated as though they were tail calls. In the example above, the let
- expression could be compiled as a tail call to h. (The possibility of h returning an
- unexpected number of values can be ignored, because in that case the effect of the
- let is explicitly unspecified and implementation-dependent.)
+Note: Implementations may recognize that some non-tail calls, such as the call to h
+above, can be evaluated as though they were tail calls. In the example above, the let
+expression could be compiled as a tail call to h. (The possibility of h returning an
+unexpected number of values can be ignored, because in that case the effect of the
+let is explicitly unspecified and implementation-dependent.)
@node Expressions
@chapter Expressions
@@ -1246,17 +1246,17 @@ procedures defined in this report return one value or, for procedures such as ap
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, (), is a legitimate expression evaluating
- to itself. In Scheme, it is an error.
+Note: In many dialects of Lisp, the empty list, (), is a legitimate expression evaluating
+to itself. In Scheme, it is an error.
@node Procedures
@subsection Procedures
@@ -1300,21 +1300,21 @@ will be returned as the results of the procedure call.
@itemize
@item
(<variable1> @dots{}): 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.
+procedure is called, the arguments will be stored in fresh locations that are bound to
+the corresponding variables.
@item
<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 <variable>.
+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 <variable>.
@item
(<variable1> @dots{} <variablen> . <variablen+1>): If a space-delimited period precedes the last
- variable, then the procedure takes n or more arguments, where 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.
+variable, then the procedure takes n or more arguments, where 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
@@ -1387,9 +1387,9 @@ effectively replace the include or include-ci expression with a begin expression
what was read from the files. The difference between the two is that include-ci reads each
file as if it began with the #!fold-case directive, while include does not.
- Note: Implementations are encouraged to search for files in the directory which
- contains the including file, and to provide a way for users to specify other directories
- to search.
+Note: Implementations are encouraged to search for files in the directory which
+contains the including file, and to provide a way for users to specify other directories
+to search.
@node Derived expression types
@section Derived expression types
@@ -1815,9 +1815,9 @@ This form of begin can appear as part of a <body>, or at the outermost level of
the contained expressions and definitions to be evaluated exactly as if the enclosing begin
construct were not present.
- Rationale: This form is commonly used in the output of macros (see section 4.3) which
- need to generate multiple definitions and splice them into the context in which they
- are expanded.
+Rationale: This form is commonly used in the output of macros (see section 4.3) which
+need to generate multiple definitions and splice them into the context in which they
+are expanded.
syntax: (begin <expression1> <expression2> @dots{})
@@ -2112,10 +2112,10 @@ 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 <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
+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.
+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
@@ -2206,9 +2206,9 @@ the list are then ``stripped away'' and the elements of the list are inserted in
comma at-sign expression sequence. A comma at-sign normally appears only within a list
or vector <qq template>.
- Note: In order to unquote an identifier beginning with @code{,} it is necessary to use either
- an explicit unquote or to put whitespace after the comma, to avoid colliding with the
- comma at-sign sequence.
+Note: In order to unquote an identifier beginning with @code{,} it is necessary to use either
+an explicit unquote or to put whitespace after the comma, to avoid colliding with the
+comma at-sign sequence.
@example
@@ -3454,9 +3454,9 @@ detect that two procedures or two literals are equivalent to each other, and can
whether or not to merge representations of equivalent objects by using the same pointer
or bit pattern to represent both.
- Note: If inexact numbers are represented as IEEE binary floating-point numbers, then
- an implementation of eqv? that simply compares equal-sized inexact numbers for
- bitwise equality is correct by the above definition.
+Note: If inexact numbers are represented as IEEE binary floating-point numbers, then
+an implementation of eqv? that simply compares equal-sized inexact numbers for
+bitwise equality is correct by the above definition.
procedure: (eq? obj1 obj2)
@@ -3868,10 +3868,10 @@ The numbers +inf.0, -inf.0, and +nan.0 are real but not rational.
Note: The behavior of these type predicates on inexact numbers is unreliable, since
any inaccuracy might affect the result.
- Note: In many implementations the complex? procedure will be the same as
- number?, but unusual implementations may represent some irrational numbers
- exactly or may extend the number system to support some kind of non-complex
- numbers.
+Note: In many implementations the complex? procedure will be the same as
+number?, but unusual implementations may represent some irrational numbers
+exactly or may extend the number system to support some kind of non-complex
+numbers.
procedure: (exact? z)
@@ -3972,18 +3972,18 @@ return #f. They do not distinguish between inexact zero and inexact negative zer
These predicates are required to be transitive.
- Note: The implementation approach of converting all arguments to inexact numbers
- if any argument is inexact is not transitive. For example, let big be (expt 2 1000), and
- assume that big is exact and that inexact numbers are represented by 64-bit IEEE
- binary floating point numbers. Then (= (- big 1) (inexact big)) and (= (inexact big) (+ big
- 1)) would both be true with this approach, because of the limitations of IEEE
- representations of large integers, whereas (= (- big 1) (+ big 1)) is false. Converting
- inexact values to exact numbers that are the same (in the sense of =) to them will
- avoid this problem, though special care must be taken with infinities.
+Note: The implementation approach of converting all arguments to inexact numbers
+if any argument is inexact is not transitive. For example, let big be (expt 2 1000), and
+assume that big is exact and that inexact numbers are represented by 64-bit IEEE
+binary floating point numbers. Then (= (- big 1) (inexact big)) and (= (inexact big) (+ big
+1)) would both be true with this approach, because of the limitations of IEEE
+representations of large integers, whereas (= (- big 1) (+ big 1)) is false. Converting
+inexact values to exact numbers that are the same (in the sense of =) to them will
+avoid this problem, though special care must be taken with infinities.
- Note: While it is not an error to compare inexact numbers using these predicates, the
- results are unreliable because a small inaccuracy can affect the result; this is
- especially true of = and zero?. When in doubt, consult a numerical analyst.
+Note: While it is not an error to compare inexact numbers using these predicates, the
+results are unreliable because a small inaccuracy can affect the result; this is
+especially true of = and zero?. When in doubt, consult a numerical analyst.
procedure: (zero? z)
@@ -4019,11 +4019,11 @@ These procedures return the maximum or minimum of their arguments.
@end example
Note: If any argument is inexact, then the result will also be inexact (unless the
- procedure can prove that the inaccuracy is not large enough to affect the result,
- which is possible only in unusual implementations). If min or max is used to compare
- numbers of mixed exactness, and the numerical value of the result cannot be
- represented as an inexact number without loss of accuracy, then the procedure may
- report a violation of an implementation restriction.
+procedure can prove that the inaccuracy is not large enough to affect the result,
+which is possible only in unusual implementations). If min or max is used to compare
+numbers of mixed exactness, and the numerical value of the result cannot be
+represented as an inexact number without loss of accuracy, then the procedure may
+report a violation of an implementation restriction.
procedure: (+ z1 @dots{})
@@ -4223,8 +4223,8 @@ procedure: (modulo n1 n2)
The quotient and remainder procedures are equivalent to truncate-quotient and
truncate-remainder, respectively, and modulo is equivalent to floor-remainder.
- Note: These procedures are provided for backward compatibility with earlier
- versions of this report.
+Note: These procedures are provided for backward compatibility with earlier
+versions of this report.
procedure: (gcd n1 @dots{})
@@ -4284,12 +4284,12 @@ x, rounding to even when
x is halfway between two integers.
- Rationale: The round procedure rounds to even for consistency with the default
- rounding mode specified by the IEEE 754 IEEE floating-point standard.
+Rationale: The round procedure rounds to even for consistency with the default
+rounding mode specified by the IEEE 754 IEEE floating-point standard.
- Note: If the argument to one of these procedures is inexact, then the result will also
- be inexact. If an exact value is needed, the result can be passed to the exact
- procedure. If the argument is infinite or a NaN, then it is returned.
+Note: If the argument to one of these procedures is inexact, then the result will also
+be inexact. If an exact value is needed, the result can be passed to the exact
+procedure. If the argument is infinite or a NaN, then it is returned.
@example
@@ -4537,8 +4537,8 @@ are exact. The real-part and imag-part procedures may return exact real numbers
applied to an inexact complex number if the corresponding argument passed to
make-rectangular was exact.
- Rationale: The magnitude procedure is the same as abs for a real argument, but abs
- is in the base library, whereas magnitude is in the optional complex library.
+Rationale: The magnitude procedure is the same as abs for a real argument, but abs
+is in the base library, whereas magnitude is in the optional complex library.
procedure: (inexact z)
@@ -4569,9 +4569,9 @@ restriction may be reported.
These procedures implement the natural one-to-one correspondence between exact and
inexact integers throughout an implementation-dependent range. See section 6.2.3.
- Note: These procedures were known in R5RS as exact->inexact and inexact->exact,
- respectively, but they have always accepted arguments of any exactness. The new
- names are clearer and shorter, as well as being compatible with R6RS.
+Note: These procedures were known in R5RS as exact->inexact and inexact->exact,
+respectively, but they have always accepted arguments of any exactness. The new
+names are clearer and shorter, as well as being compatible with R6RS.
@node Numerical input and output
@subsection Numerical input and output
@@ -4610,16 +4610,16 @@ make the above expression true [4, 5]; otherwise the format of the result is uns
The result returned by number->string never contains an explicit radix prefix.
- Note: The error case can occur only when
+Note: The error case can occur only when
- z is not a complex number or is a complex number with a non-rational real or
- imaginary part.
+z is not a complex number or is a complex number with a non-rational real or
+imaginary part.
- Rationale: If
+Rationale: If
- z is an inexact number and the radix is 10, then the above expression is normally
- satisfied by a result containing a decimal point. The unspecified case allows for
- infinities, NaNs, and unusual representations.
+z is an inexact number and the radix is 10, then the above expression is normally
+satisfied by a result containing a decimal point. The unspecified case allows for
+infinities, NaNs, and unusual representations.
procedure: (string->number string)
procedure: (string->number string radix)
@@ -4684,8 +4684,8 @@ object treated as true by the conditional expressions, and the phrase ``a false
Of all the Scheme values, only #f counts as false in conditional expressions. All other
Scheme values, including #t, count as true.
- Note: Unlike some other dialects of Lisp, Scheme distinguishes #f and the empty list
- from each other and from the symbol nil.
+Note: Unlike some other dialects of Lisp, Scheme distinguishes #f and the empty list
+from each other and from the symbol nil.
Boolean constants evaluate to themselves, so they do not need to be quoted in
programs.
@@ -4771,8 +4771,8 @@ is the number of elements, which is the same as the number of pairs.
The empty listis a special object of its own type. It is not a pair, it has no elements, and its
length is zero.
- Note: The above definitions imply that all lists have finite length and are terminated
- by the empty list.
+Note: The above definitions imply that all lists have finite length and are terminated
+by the empty list.
The most general notation (external representation) for Scheme pairs is the ``dotted''
notation (
@@ -5246,10 +5246,10 @@ It is guaranteed that any symbol that has been returned as part of a literal exp
or read using the read procedure, and subsequently written out using the write
procedure, will read back in as the identical symbol (in the sense of eqv?).
- Note: Some implementations have values known as ``uninterned symbols,'' which
- defeat write/read invariance, and also violate the rule that two symbols are the
- same if and only if their names are spelled the same. This report does not specify
- the behavior of implementation-dependent extensions.
+Note: Some implementations have values known as ``uninterned symbols,'' which
+defeat write/read invariance, and also violate the rule that two symbols are the
+same if and only if their names are spelled the same. This report does not specify
+the behavior of implementation-dependent extensions.
procedure: (symbol? obj)
@@ -5273,8 +5273,8 @@ procedure: (symbol=? symbol1 symbol2 symbol3 @dots{})
Returns #t if all the arguments all have the same names in the sense of string=?.
- Note: The definition above assumes that none of the arguments are uninterned
- symbols.
+Note: The definition above assumes that none of the arguments are uninterned
+symbols.
procedure: (symbol->string symbol)
@@ -7104,11 +7104,11 @@ proc are returned. If
proc does not return, then the port must not be closed automatically unless it is possible
to prove that the port will never again be used for a read or write operation.
- Rationale: Because Scheme's escape procedures have unlimited extent, it is possible
- to escape from the current continuation but later to resume it. If implementations
- were permitted to close the port on any escape from the current continuation, then
- it would be impossible to write portable code using both
- call-with-current-continuation and call-with-port.
+Rationale: Because Scheme's escape procedures have unlimited extent, it is possible
+to escape from the current continuation but later to resume it. If implementations
+were permitted to close the port on any escape from the current continuation, then
+it would be impossible to write portable code using both
+call-with-current-continuation and call-with-port.
file library procedure: (call-with-input-file string proc)
file library procedure: (call-with-output-file string proc)
@@ -7307,14 +7307,14 @@ port, but without updating the
port to point to the following character. If no more characters are available, an end-of-file
object is returned.
- Note: The value returned by a call to peek-char is the same as the value that would
- have been returned by a call to read-char with the same
+Note: The value returned by a call to peek-char is the same as the value that would
+have been returned by a call to read-char with the same
- port. The only difference is that the very next call to read-char or peek-char on that
+port. The only difference is that the very next call to read-char or peek-char on that
- port will return the value returned by the preceding call to peek-char. In particular, a
- call to peek-char on an interactive port will hang waiting for input whenever a call to
- read-char would have hung.
+port will return the value returned by the preceding call to peek-char. In particular, a
+call to peek-char on an interactive port will hang waiting for input whenever a call to
+read-char would have hung.
procedure: (read-line)
procedure: (read-line port)
@@ -7357,12 +7357,12 @@ port is guaranteed not to hang. If the
port is at end of file then char-ready? returns #t.
- Rationale: The char-ready? procedure exists to make it possible for a program to
- accept characters from interactive ports without getting stuck waiting for input.
- Any input editors associated with such ports must ensure that characters whose
- existence has been asserted by char-ready? cannot be removed from the input. If
- char-ready? were to return #f at end of file, a port at end of file would be
- indistinguishable from an interactive port that has no ready characters.
+Rationale: The char-ready? procedure exists to make it possible for a program to
+accept characters from interactive ports without getting stuck waiting for input.
+Any input editors associated with such ports must ensure that characters whose
+existence has been asserted by char-ready? cannot be removed from the input. If
+char-ready? were to return #f at end of file, a port at end of file would be
+indistinguishable from an interactive port that has no ready characters.
procedure: (read-string k)
procedure: (read-string k port)
@@ -7504,8 +7504,8 @@ that do not have datum representations.
The display procedure returns an unspecified value.
- Rationale: The write procedure is intended for producing machine-readable output
- and display for producing human-readable output.
+Rationale: The write procedure is intended for producing machine-readable output
+and display for producing human-readable output.
procedure: (newline)
procedure: (newline port)
@@ -7596,8 +7596,8 @@ It is unspecified whether the results of the expressions are printed. The load p
does not affect the values returned by current-input-port and current-output-port. It
returns an unspecified value.
- Rationale: For portability, load must operate on source files. Its operation on other
- kinds of files necessarily varies among implementations.
+Rationale: For portability, load must operate on source files. Its operation on other
+kinds of files necessarily varies among implementations.
file library procedure: (file-exists? filename)
@@ -7642,8 +7642,8 @@ obj into an appropriate exit value for the operating system, if possible.
The exit procedure must not signal an exception or return to its continuation.
- Note: Because of the requirement to run handlers, this procedure is not just the
- operating system's exit procedure.
+Note: Because of the requirement to run handlers, this procedure is not just the
+operating system's exit procedure.
process-context library procedure: (emergency-exit)
process-context library procedure: (emergency-exit obj)
@@ -7653,8 +7653,8 @@ Terminates the program without running any outstanding dynamic-wind
after procedures and communicates an exit value to the operating system in the same
manner as exit.
- Note: The emergency-exit procedure corresponds to the _exit procedure in Windows
- and Posix.
+Note: The emergency-exit procedure corresponds to the _exit procedure in Windows
+and Posix.
process-context library procedure: (get-environment-variable name)
@@ -7709,13 +7709,13 @@ which is defined by the return value of the jiffies-per-second procedure. The st
epoch is guaranteed to be constant during a run of the program, but may vary between
runs.
- Rationale: Jiffies are allowed to be implementation-dependent so that current-jiffy
- can execute with minimum overhead. It should be very likely that a compactly
- represented integer will suffice as the returned value. Any particular jiffy size will be
- inappropriate for some implementations: a microsecond is too long for a very fast
- machine, while a much smaller unit would force many implementations to return
- integers which have to be allocated for most calls, rendering current-jiffy less
- useful for accurate timing measurements.
+Rationale: Jiffies are allowed to be implementation-dependent so that current-jiffy
+can execute with minimum overhead. It should be very likely that a compactly
+represented integer will suffice as the returned value. Any particular jiffy size will be
+inappropriate for some implementations: a microsecond is too long for a very fast
+machine, while a much smaller unit would force many implementations to return
+integers which have to be allocated for most calls, rendering current-jiffy less
+useful for accurate timing measurements.
time library procedure: (jiffies-per-second)
@@ -8059,8 +8059,8 @@ The interpretation as an <unquotation> or <splicing unquotation D> takes precede
@node Programs and definitions
@subsection Programs and definitions
- Note: Though this grammar does not say so, a top-level syntax-rules pattern must be
- a list pattern, not a vector pattern or an identifier pattern.
+Note: Though this grammar does not say so, a top-level syntax-rules pattern must be
+a list pattern, not a vector pattern or an identifier pattern.
<transformer spec> ⟶ (syntax-rules (<identifier>*) <syntax rule>*)
∣(syntax-rules <identifier> (<identifier>*)