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 431a303b3357804a1d244d86143c785bed5cee25
parent bb2830195ddad6a7330cc3e3984d84c2087d23bc
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Mon,  5 Feb 2024 15:55:21 -0500

Clean up tail-context def. and simplify syn. var. markup.

Diffstat:
Mdoc/r7rs-small/basic-concepts.texinfo | 71++++++++++++++++++++++++++++++++++-------------------------------------
Mdoc/r7rs-small/r7rs-texinfo-macros.texinfo | 5+++++
2 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/doc/r7rs-small/basic-concepts.texinfo b/doc/r7rs-small/basic-concepts.texinfo @@ -269,54 +269,51 @@ syntax and semantics} by replacing some occurrences of @svar{body} with expression}, and some occurrences of @svar{sequence} with @svar{tail sequence}. Only those rules that contain tail contexts are shown here. -@c Maybe @format would be better here. FIXME: We still need markup -@c for metavariables. -@display -(@code{if} @svar{expression} @svar{tail expression} @svar{tail expression}) -(@code{if} @svar{expression} @svar{tail expression}) +@lisp +(if @rsvar{expression} @rsvar{tail expression} @rsvar{tail expression}) +(if @rsvar{expression} @rsvar{tail expression}) -(@code{cond} @svar{cond clause}@sup{+}) -(@code{cond} @svar{cond clause}* (else @svar{tail sequence})) +(cond @rsvar{cond clause}@sup{@r{+}}) +(cond @rsvar{cond clause}@r{*} (else @rsvar{tail sequence})) -(@code{case} @svar{expression} - @svar{case clause}@sup{+}) -(@code{case} @svar{expression} - @svar{case clause}* - (else @svar{tail sequence})) +(case @rsvar{expression} + @rsvar{case clause}@sup{+}) +(case @rsvar{expression} + @rsvar{case clause}@r{*} + (else @rsvar{tail sequence})) -(@code{and} @svar{expression}* @svar{tail expression}) -(@code{or} @svar{expression}* @svar{tail expression}) +(and @rsvar{expression}@r{*} @rsvar{tail expression}) +(or @rsvar{expression}@r{*} @rsvar{tail expression}) -(@code{when} @svar{test} @svar{tail sequence}) -(@code{unless} @svar{test} @svar{tail sequence}) +(when @rsvar{test} @rsvar{tail sequence}) +(unless @rsvar{test} @rsvar{tail sequence}) -(@code{let} (@svar{binding spec}*) @svar{tail body}) -(@code{let} @svar{variable} (@svar{binding spec}*) @svar{tail body}) -(@code{let*} (@svar{binding spec}*) @svar{tail body}) -(@code{letrec} (@svar{binding spec}*) @svar{tail body}) -(@code{letrec*} (@svar{binding spec}*) @svar{tail body}) -(@code{let-values} (@svar{mv binding spec}*) @svar{tail body}) -(@code{let*-values} (@svar{mv binding spec}*) @svar{tail body}) +(let (@rsvar{binding spec}@r{*}) @rsvar{tail body}) +(let @rsvar{variable} (@rsvar{binding spec}@r{*}) @rsvar{tail body}) +(let* (@rsvar{binding spec}@r{*}) @rsvar{tail body}) +(letrec (@rsvar{binding spec}@r{*}) @rsvar{tail body}) +(letrec* (@rsvar{binding spec}@r{*}) @rsvar{tail body}) +(let-values (@rsvar{mv binding spec}@r{*}) @rsvar{tail body}) +(let*-values (@rsvar{mv binding spec}@r{*}) @rsvar{tail body}) -(@code{let-syntax} (@svar{syntax spec}*) @svar{tail body}) -(@code{letrec-syntax} (@svar{syntax spec}*) @svar{tail body}) +(let-syntax (@rsvar{syntax spec}@r{*}) @rsvar{tail body}) +(letrec-syntax (@rsvar{syntax spec}@r{*}) @rsvar{tail body}) -(@code{begin} @svar{tail sequence}) +(begin @rsvar{tail sequence}) -(@code{do} (@svar{iteration spec}*) - (@svar{test} @svar{tail sequence}) - @svar{expression}*) -@end display +(do (@rsvar{iteration spec}@r{*}) + (@rsvar{test} @rsvar{tail sequence}) + @rsvar{expression}@r{*}) +@end lisp where -@display -@svar{cond clause} @expansion{} (@svar{test} @svar{tail sequence}) -@svar{case clause} @expansion{} ((@svar{datum}*) @svar{tail sequence}) -@svar{tail body} @expansion{} @svar{definition}* @svar{tail sequence} -@svar{tail sequence} @expansion{} @svar{expression}* @svar{tail expression} - -@end display +@lisp +@rsvar{cond clause} @expansion{} (@rsvar{test} @rsvar{tail sequence}) +@rsvar{case clause} @expansion{} ((@rsvar{datum}@r{*}) @rsvar{tail sequence}) +@rsvar{tail body} @expansion{} @rsvar{definition}@r{*} @rsvar{tail sequence} +@rsvar{tail sequence} @expansion{} @rsvar{expression}@r{*} @rsvar{tail expression} +@end lisp @item If a @code{cond} or @code{case} expression is in a tail context, and diff --git a/doc/r7rs-small/r7rs-texinfo-macros.texinfo b/doc/r7rs-small/r7rs-texinfo-macros.texinfo @@ -51,6 +51,11 @@ R@sup{6}RS @end macro @end iftex +@c For use in code examples where the default font is not Roman. +@macro rsvar {name} +@r{@svar{\name\}} +@end macro + @c Greek characters. @c Apparently lambda, iota, etc. are already in the Texinfo macro