r7rs-small-texinfo

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit f143296d1c4e7071b96c42eddf41aa7e622725b5
parent ddfd2f90bbee399ed999e3d734e0c9f4eabce45e
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Mon, 29 Jan 2024 13:44:14 -0500

Add some headings, begin list formatting.

Diffstat:
Mdoc/r7rs-small/r7rs-small.texinfo | 130+++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 77 insertions(+), 53 deletions(-)

diff --git a/doc/r7rs-small/r7rs-small.texinfo b/doc/r7rs-small/r7rs-small.texinfo @@ -121,7 +121,7 @@ arithmetic. More recently, Scheme became the first programming language to suppo hygienic macros, which permit the syntax of a block-structured language to be extended in a consistent and reliable manner. -Background +@heading Background The first description of Scheme was written in 1975 [35]. A revised report [31] appeared in 1978, which described the evolution of the language as its MIT implementation was @@ -162,7 +162,7 @@ permission to copy it in whole or in part without fee. In particular, we encoura implementers of Scheme to use this report as a starting point for manuals and other documentation, modifying it as necessary. -Acknowledgments +@heading Acknowledgments We would like to thank the members of the Steering Committee, William Clinger, Marc Feeley, Chris Hanson, Jonathan Rees, and Olin Shivers, for their support and guidance. @@ -291,19 +291,26 @@ is given in Appendix A. All implementations of Scheme: -* Must provide the base library and all the identifiers exported from it. +@itemize +@item +Must provide the base library and all the identifiers exported from it. -* May provide or omit the other libraries given in this report, but each library must either +@item +May provide or omit the other libraries given in this report, but each library must either be provided in its entirety, exporting no additional identifiers, or else omitted altogether. -* May provide other libraries not described in this report. +@item +May provide other libraries not described in this report. -* May also extend the function of any identifier in this report, provided the extensions +@item +May also extend the function of any identifier in this report, provided the extensions are not in conflict with the language reported here. -* Must support portable code by providing a mode of operation in which the lexical +@item +Must support portable code by providing a mode of operation in which the lexical syntax does not conflict with the lexical syntax described in this report. +@end itemize @node Error situations and unspecified behavior @subsection Error situations and unspecified behavior @@ -502,39 +509,31 @@ start and end are used as indexes into strings, vectors, and bytevectors. Their use implies the following: -* It is an error if +@itemize +@item +It is an error if start is greater than end. - start is greater than +@item +It is an error if end is greater than the length of the string, +vector, or bytevector. - end. +@item +If start is omitted, it is assumed to be zero. -* It is an error if +@item +If end is omitted, it assumed to be the length of the string, vector, +or bytevector. - end is greater than the length of the string, vector, or bytevector. - -* If - - start is omitted, it is assumed to be zero. - -* If - - end is omitted, it assumed to be the length of the string, vector, or bytevector. - -* The index - - start is always inclusive and the index - - end is always exclusive. As an example, consider a string. If - - start and - - end are the same, an empty substring is referred to, and if - - start is zero and - - end is the length of +@item +The index start is always inclusive and the index +end is always exclusive. As an example, consider a string. If +start and +end are the same, an empty substring is referred to, and if +start is zero and +end is the length of +string, then the entire string is referred to. - string, then the entire string is referred to. +@end itemize @node Evaluation examples @subsection Evaluation examples @@ -622,11 +621,16 @@ identifiers. Identifiers have two uses within Scheme programs: -* Any identifier can be used as a variableor as a syntactic keyword(see sections 3.1 and - 4.3). +@itemize +@item +Any identifier can be used as a variable or as a syntactic keyword +(see sections 3.1 and 4.3). -* When an identifier appears as a literal or within a literal (see section 4.1.2), it is being - used to denote a symbol (see section 6.5). +@item +When an identifier appears as a literal or within a literal (see +section 4.1.2), it is being used to denote a symbol (see section 6.5). + +@end itemize In contrast with earlier revisions of the report [20], the syntax distinguishes between upper and lower case in identifiers and in characters specified using their names. @@ -796,14 +800,14 @@ In particular, it is an error for quasiquote (section 4.2.8) to contain them. @chapter Basic concepts @menu -* Variables - syntactic keywords - and regions:: +* Variables, syntactic keywords, and regions: Variables:: * Disjointness of types:: -* External representations (basic):: +* External representations:: * Storage model:: * Proper tail recursion:: @end menu -@node Variables - syntactic keywords - and regions +@node Variables @section Variables, syntactic keywords, and regions An identifiercan name either a type of syntax or a location where a value can be stored. An @@ -969,7 +973,9 @@ A tail callis a procedure call that occurs in a tail context. Tail contexts are inductively. Note that a tail context is always determined with respect to a particular lambda expression. -* The last expression within the body of a lambda expression, shown as <tail expression> +@itemize +@item +The last expression within the body of a lambda expression, shown as <tail expression> below, occurs in a tail context. The same is true of all the bodies of case-lambda expressions. @@ -981,7 +987,8 @@ lambda expression. @end example -* If one of the following expressions is in a tail context, then the subexpressions shown +@item +If one of the following expressions is in a tail context, then the subexpressions shown as <tail expression> are in a tail context. These were derived from rules in the grammar given in chapter 7 by replacing some occurrences of <body> with <tail body>, some occurrences of <expression> with <tail expression>, and some occurrences of @@ -1024,11 +1031,14 @@ lambda expression. @end example -* If a cond or case expression is in a tail context, and has a clause of the form +@item +If a cond or case expression is in a tail context, and has a clause of the form (<expression1> => <expression2>) then the (implied) call to the procedure that results from the evaluation of <expression2> is in a tail context. <expression2> itself is not in a tail context. +@end itemize + Certain procedures defined in this report are also required to perform tail calls. The first argument passed to apply and to call-with-current-continuation, and the second argument passed to call-with-values, must be called via a tail call. Similarly, eval must @@ -1233,21 +1243,27 @@ will be returned as the results of the procedure call. <Formals> have one of the following forms: -* (<variable1> …): The procedure takes a fixed number of arguments; when the +@itemize +@item +(<variable1> …): 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. -* <variable>: The procedure takes any number of arguments; when the procedure is +@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>. -* (<variable1> … <variablen> . <variablen+1>): If a space-delimited period precedes the last +@item +(<variable1> … <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. +@end itemize + It is an error for a <variable> to appear more than once in <formals>. @example @@ -1502,15 +1518,23 @@ The last clause can be an “else clause,” which has the form A <feature requirement> takes one of the following forms: -* <feature identifier> +@itemize +@item +<feature identifier> + +@item +(library <library name>) -* (library <library name>) +@item +(and <feature requirement> …) -* (and <feature requirement> …) +@item +(or <feature requirement> …) -* (or <feature requirement> …) +@item +(not <feature requirement>) -* (not <feature requirement>) +@end itemize Semantics: Each implementation maintains a list of feature identifiers which are present, as well as a list of libraries which can be imported. The value of a <feature requirement> is