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 c6fd58dd0131f8a2835093c36b682e3f0fc7b1e2
parent d12c7f172615623202b2d69bbd037d194821a64f
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Mon,  5 Feb 2024 14:03:39 -0500

Overview, Lexical: Clean up markup and fix some typos.

Diffstat:
Mdoc/r7rs-small/lexical-conventions.texinfo | 92++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mdoc/r7rs-small/overview.texinfo | 10+++++-----
2 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/doc/r7rs-small/lexical-conventions.texinfo b/doc/r7rs-small/lexical-conventions.texinfo @@ -2,7 +2,7 @@ @chapter Lexical conventions This section gives an informal account of some of the lexical conventions used in writing -Scheme programs. For a formal syntax of Scheme, see section 7.1. +Scheme programs. For a formal syntax of Scheme, see @ref{Formal syntax}. @menu * Identifiers:: @@ -14,16 +14,16 @@ Scheme programs. For a formal syntax of Scheme, see section 7.1. @node Identifiers @section Identifiers -An identifieris any sequence of letters, digits, and ``extended identifier characters'' -provided that it does not have a prefix which is a valid number. However, the . token (a +An identifier is any sequence of letters, digits, and ``extended identifier characters'' +provided that it does not have a prefix which is a valid number. However, the @code{.} token (a single period) used in the list syntax is not an identifier. All implementations of Scheme must support the following extended identifier characters: -@lisp +@example ! $ % & * + - . / : < = > ? @ ^ _ ~ -@end lisp +@end example Alternatively, an identifier can be represented by a sequence of zero or more characters enclosed within vertical lines (@samp{|}), analogous to string literals. @@ -33,12 +33,12 @@ specified using either an @svar{inline hex escape} or the same escapes available For example, the identifier @code{|H\x65;llo|} is the same identifier as @code{Hello}, and in an implementation that supports the appropriate Unicode character the identifier @code{|\x3BB;|} -is the same as the identifier @math{\lambda}. What is more, @code{|\t\t|} and @code{|\x9;\x9;|} are the same. Note +is the same as the identifier @theultimate{}. What is more, @code{|\t\t|} and @code{|\x9;\x9;|} are the same. Note that @code{||} is a valid identifier that is different from any other identifier. Here are some examples of identifiers: -@lisp +@example ... + +soup+ <=? ->string a34kTMNs @@ -46,7 +46,7 @@ lambda list->vector q V17a |two words| |two\x20;words| the-word-recursion-has-many-meanings -@end lisp +@end example @xref{Formal syntax} for the formal syntax of identifiers. @@ -56,19 +56,19 @@ Identifiers have two uses within Scheme programs: @itemize @item Any identifier can be used as a variable or as a syntactic keyword -(see @ref{Variables - syntactic keywords - and regions,, Variables, syntactic keywords, and regions} +(see @ref{Variables - syntactic keywords - and regions} and @ref{Macros}). @item When an identifier appears as a literal or within a literal (see -@{Literal expressions}), it is being used to denote a @dfn{symbol} (see @ref{Symbols}). +@ref{Literal expressions}), it is being used to denote a @dfn{symbol} (see @ref{Symbols}). @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. -However, it does not distinguish between upper and lower case in numbers, nor in <inline -hex escapes> used in the syntax of identifiers, characters, or strings. None of the +However, it does not distinguish between upper and lower case in numbers, nor in @svar{inline +hex escapes} used in the syntax of identifiers, characters, or strings. None of the identifiers defined in this report contain upper-case characters, even when they appear to do so as a result of the English-language convention of capitalizing the first word of a sentence. @@ -101,10 +101,10 @@ significant. The lexical syntax includes several comment forms. Comments are treated exactly like whitespace. -A semicolon (@samp{;}) indicates the start of a line comment.The comment continues to the end +A semicolon (@samp{;}) indicates the start of a line comment. The comment continues to the end of the line on which the semicolon appears. Another way to indicate a comment is to prefix a @svar{datum} (cf. @ref{External representations}) with @code{#;} and optional @svar{whitespace}. The comment -consists of the comment prefix #;, the space, and the @svar{datum} together. This notation is +consists of the comment prefix @code{#;}, the space, and the @svar{datum} together. This notation is useful for ``commenting out'' sections of code. Block comments are indicated with properly nested @code{#|} and @code{|#} pairs. @@ -129,76 +129,76 @@ For a description of the notations used for numbers, see @ref{Numbers}. @table @t -@item @t{. + -} +@item @code{. + -} These are used in numbers, and can also occur anywhere in an identifier. A delimited plus or minus sign by itself is also an identifier. A delimited period (not occurring within a number or identifier) is used in the notation for pairs (@ref{Pairs and lists}), and to - indicate a rest-parameter in a formal parameter list (@{Procedures}). Note that a + indicate a rest-parameter in a formal parameter list (@ref{Procedures}). Note that a sequence of two or more periods is an identifier. -@item @t{( )} +@item @code{( )} Parentheses are used for grouping and to notate lists (@ref{Pairs and lists}). -@item @t{'} +@item @code{'} The apostrophe (single quote) character is used to indicate literal data (@ref{Literal expressions}). -@item @t{`} +@item @code{`} The grave accent (backquote) character is used to indicate partly constant data (@ref{Quasiquotation}). -@item @t{, ,@@} +@item @code{, ,@@} The character comma and the sequence comma at-sign are used in conjunction with quasiquotation (@ref{Quasiquotation}). -@item @t{"} +@item @code{"} The quotation mark character is used to delimit strings (@ref{Strings}). -@item @t{\} +@item @code{\} Backslash is used in the syntax for character constants (@ref{Characters}) and as an escape - character within string constants (@{Strings}) and identifiers (@ref{Lexical structure}). + character within string constants (@ref{Strings}) and identifiers (@ref{Lexical structure}). -@item @t{[ ] @{ @} |} +@item @code{[ ] @@ |} Left and right square and curly brackets (braces) are reserved for possible future extensions to the language. -@item @t{#} +@item @code{#} The number sign is used for a variety of purposes depending on the character that immediately follows it: -@item @t{#t #f} - These are the boolean constants (@ref{Booleans}), along with the alternatives #true and - #false. +@item @code{#t #f} + These are the boolean constants (@ref{Booleans}), along with the alternatives @code{#true} and + @code{#false}. -@item @t{#\} +@item @code{#\} This introduces a character constant (@ref{Characters}). -@item @t{#(} - This introduces a vector constant (@ref{Vectors}). Vector constants are terminated by ) . +@item @code{#(} + This introduces a vector constant (@ref{Vectors}). Vector constants are terminated by @code{)}. -@item @t{#u8(} +@item @code{#u8(} This introduces a bytevector constant (@ref{Bytevectors}). Bytevector constants are terminated by @code{)} . -@item @t{#e #i #b #o #d #x} +@item @code{#e #i #b #o #d #x} These are used in the notation for numbers (@ref{Syntax of numerical constants}). -@item @t{#<n>= #<n>#} - These are used for labeling and referencing other literal data (@{Datum labels}). +@item @code{#@r{@svar{n}}= #@r{@svar{n}}#} + These are used for labeling and referencing other literal data (@ref{Datum labels}). @end table @node Datum labels @section Datum labels -@deffn {lexical syntax} #<n>=<datum> -@deffnx {lexical syntax} #<n># +@deffn {lexical syntax} #@svar{n}=@svar{datum} +@deffnx {lexical syntax} #@svar{n}# -The lexical syntax @code{#}<n>@code{=}<datum> reads the same as <datum>, but also results in <datum> -being labelled by <n>. It is an error if <n> is not a sequence of digits. +The lexical syntax @code{#}@svar{n}@code{=}@svar{datum} reads the same as @svar{datum}, but also results in @svar{datum} +being labelled by @svar{n}. It is an error if @svar{n} is not a sequence of digits. -The lexical syntax @code{#}<n>@code{#} serves as a reference to some object labelled by @code{#}<n>@code{=}; the -result is the same object as the @code{#}<n>@code{=} (see @ref{Equivalence predicates}). Together, these syntaxes permit +The lexical syntax @code{#}@svar{n}@code{#} serves as a reference to some object labelled by @code{#}@svar{n}@code{=}; the +result is the same object as the @code{#}@svar{n}@code{=} (see @ref{Equivalence predicates}). Together, these syntaxes permit the notation of structures with shared or circular substructure. @lisp @@ -208,12 +208,12 @@ the notation of structures with shared or circular substructure. @end lisp The scope of a datum label is the portion of the outermost datum in which it appears that -is to the right of the label. Consequently, a reference @code{#}<n>@code{#} can occur only after a label -@code{#}<n>@code{=}; it is an error to attempt a forward reference. In addition, it is an error if the -reference appears as the labelled object itself (as in @code{#}<n>@code{=} @code{#}<n>@code{#}), because the object -labelled by @code{#}<n>@code{=} is not well defined in this case. +is to the right of the label. Consequently, a reference @code{#}@svar{n}@code{#} can occur only after a label +@code{#}@svar{n}@code{=}; it is an error to attempt a forward reference. In addition, it is an error if the +reference appears as the labelled object itself (as in @code{#}@svar{n}@code{=} @code{#}@svar{n}@code{#}), because the object +labelled by @code{#}@svar{n}@code{=} is not well defined in this case. -It is an error for a <program> or <library> to include circular references except in literals. +It is an error for a @svar{program} or @svar{library} to include circular references except in literals. In particular, it is an error for quasiquote (@ref{Quasiquotation}) to contain them. @lisp diff --git a/doc/r7rs-small/overview.texinfo b/doc/r7rs-small/overview.texinfo @@ -60,8 +60,8 @@ is that Scheme programs and data can easily be treated uniformly by other Scheme programs. For example, the eval procedure evaluates a Scheme program expressed as data. -The read procedure performs syntactic as well as lexical decomposition of the data it -reads. The read procedure parses its input as data (@ref{External representations formal,, External representations}), not as program. +The @code{read} procedure performs syntactic as well as lexical decomposition of the data it +reads. The @code{read} procedure parses its input as data (@ref{External representations formal,, External representations}), not as program. The formal syntax of Scheme is described in @ref{Formal syntax}. @@ -79,8 +79,8 @@ The formal syntax of Scheme is described in @ref{Formal syntax}. @node Base and optional features @subsection Base and optional features -Every identifier defined in this report appears in one or more of several libraries. -Identifiers defined in the base library are not marked specially in the body of the report. +Every identifier defined in this report appears in one or more of several @dfn{libraries}. +Identifiers defined in the @dfn{base library} are not marked specially in the body of the report. This library includes the core syntax of Scheme and generally useful procedures that manipulate data. For example, the variable @code{abs} is bound to a procedure of one argument that computes the absolute value of a number, and the variable @code{+} is bound to a procedure @@ -378,7 +378,7 @@ Similarly, @samp{!} is the final character of the names of procedures that store previously allocated locations (@ref{Storage model}). Such procedures are called @dfn{mutation procedures}. The value returned by a mutation procedure is unspecified. -By convention, ``@samp{->}'' appears within the names of procedures that take an object of one +By convention, @samp{->} appears within the names of procedures that take an object of one type and return an analogous object of another type. For example, @code{list->vector} takes a list and returns a vector whose elements are the same as those of the list.