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 | README

commit 59924c6e1ea7668df2d43d5fbc9b7bfc5b458458
parent 9cb58673c8e5b3a8b6368af1f3dfe32130f4382b
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Fri,  9 Feb 2024 14:41:22 -0500

Formal syntax: More.

Diffstat:
Mdoc/r7rs-small/formal-syntax.texinfo | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 91 insertions(+), 2 deletions(-)

diff --git a/doc/r7rs-small/formal-syntax.texinfo b/doc/r7rs-small/formal-syntax.texinfo @@ -492,7 +492,44 @@ It is presented as a recipe for generating an infinite number of production rules. Imagine a copy of the following rules for @var{D} = 1, 2, 3, @dots{}, where @var{D} is the nesting depth. -[grammar] +@indentedblock +@svar{quasiquotation} @expansion{} @svar{quasiquotation 1} + +@svar{qq template 0} @expansion{} @svar{expression} + +@svar{quasiquotation @var{D}} @expansion{} + @code{`}@svar{qq template @var{D}} + | @code{(quasiquote }@svar{qq template @var{D}}@code{)} + +@svar{qq template @var{D}} @expansion{} @svar{simple datum} + | @svar{list qq template @var{D}} + | @svar{vector qq template @var{D}} + | @svar{unquotation @var{D}} + +@svar{list qq template @var{D}} @expansion{} + @code{(}@arbno{@svar{qq template or splice @var{D}}}@code{)} + | @code{(}@atleastone{@svar{qq template or splice @var{D}}} @code{.} + @svar{qq template @var{D}}@code{)} + | @code{'}@svar{qq template @var{D}} + | @svar{quasiquotation @var{D}+1} + +@svar{vector qq template @var{D}} @expansion{} + @code{@hashchar{}(}@arbno{@svar{qq template or + splice @var{D}}}@code{)} + +@svar{unquotation @var{D}} @expansion{} + @code{,}@svar{qq template @var{D}@minus{}1} + | @code{(unquote }@svar{qq template @var{D}@minus{}1}@code{)} + +@svar{qq template or splice @var{D}} @expansion{} + @svar{qq template @var{D}} + | @svar{splicing unquotation @var{D}} + +@svar{splicing unquotation @var{D}} @expansion{} + @code{,@@}@svar{qq template @var{D}@minus{}1} + | @code{(unquote-splicing }@svar{qq template @var{D}@minus{}1}) + +@end indentedblock In @svar{quasiquotation}s, a @svar{list qq template @var{D}} can sometimes be confused with either an @svar{unquotation @var{D}} or a @@ -508,7 +545,59 @@ Note: Though this grammar does not say so, a top-level @code{syntax-rules} pattern must be a list pattern, not a vector pattern or an identifier pattern. -[grammar] +@indentedblock + +@svar{transformer spec} @expansion{} + @code{(syntax-rules }(@arbno{@svar{identifier}}@code{)} + @arbno{@svar{syntax rule}}@code{)} + | @code{(syntax-rules }@svar{identifier} + @code{(}@arbno{@svar{identifier}}@code{)} + @arbno{@svar{syntax rule}}@code{)} + +@svar{syntax rule} @expansion{} + @code{(}@svar{pattern} @svar{template}@code{)} + +@svar{pattern} @expansion{} @svar{pattern identifier} + | @svar{underscore} + | @code{(}@arbno{@svar{pattern}}@code{)} + | @code{(}@atleastone{@svar{pattern}} @code{.} @svar{pattern}@code{)} + | @code{(}@arbno{@svar{pattern}} @svar{pattern} @svar{ellipsis} + @arbno{@svar{pattern}}@code{)} + | @code{(}@arbno{@svar{pattern}} @svar{pattern} @svar{ellipsis} + @arbno{@svar{pattern}} @code{.} @svar{pattern}@code{)} + | @code{@hashchar{}(}@arbno{@svar{pattern}}@code{)} + | @code{@hashchar{}(}@arbno{@svar{pattern}} @svar{pattern} + @svar{ellipsis} @arbno{@svar{pattern}}@code{)} + | @svar{pattern datum} + +@svar{pattern datum} @expansion{} @svar{string} + | @svar{character} + | @svar{boolean} + | @svar{number} + | @svar{bytevector} + +@svar{template} @expansion{} @svar{pattern identifier} + | @code{(}@arbno{@svar{template element}}@code{)} + | @code{(}@atleastone{@svar{template element}} @code{.} + @svar{template}@code{)} + | @code{@hashchar{}(}@arbno{@svar{template element}}@code{)} + | @svar{template datum} + +@svar{template element} @expansion{} @svar{template} + | @svar{template} @svar{ellipsis} + +@svar{template datum} @expansion{} @svar{pattern datum} + +@c Don't use @dots{} for the ellipsis identifier; this will emit an +@c ellipsis character in most output formats, which is wrong here. +@svar{pattern identifier} @expansion{} + @svar{any identifier except @code{...}} + +@svar{ellipsis} @expansion{} @svar{an identifier defaulting to @code{...}} + +@svar{underscore} @expansion{} @svar{the identifier @code{_}} + +@end indentedblock @node Programs and definitions @subsection Programs and definitions