From cac85e0be5833902081c903f75e348b949294fb9 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 30 Aug 2015 10:58:38 +0100 Subject: [PATCH] doc/: Document where declarations are permitted in macros. --- doc/clang.tex | 27 +++++++++++++++++++-------- doc/lispintro.tex | 11 ++++++----- doc/misc.tex | 49 ++++++++++++++++++++++++++++++++----------------- doc/parsing.tex | 32 ++++++++++++++++++++------------ 4 files changed, 77 insertions(+), 42 deletions(-) diff --git a/doc/clang.tex b/doc/clang.tex index 52e330d..9462942 100644 --- a/doc/clang.tex +++ b/doc/clang.tex @@ -138,7 +138,10 @@ type specifier. Type specifiers fit into two syntactic categories. \end{describe} \begin{describe}{mac} - {define-c-type-syntax @ @ @
^* @> @} + {define-c-type-syntax @ @ \\ \ind + @[[ @^* @! @ @]] \\ + @^* \- + \nlret @} Defines the symbol @ as a new type operator. When a list of the form @|(@ @^*)| is used as a type specifier, the @s are bound to fresh variables according to @ (a destructuring @@ -265,7 +268,9 @@ argument lists for methods. This is done by @|c-type-equal-p|. \end{describe} \begin{describe}{mac} - {maybe-in-parens (@ @) @^*} + {maybe-in-parens (@ @) + @^* + @^*} The @ is evaluated, and then the @s are evaluated in sequence within a pretty-printer logical block writing to the stream named by the symbol @. If the @ evaluates to nil, then @@ -800,13 +805,17 @@ Temporary names are represented by objects which implement a simple protocol. \end{describe} \begin{describe}{mac} - {definst @ (@ \&key @) (@^*) - @^*} + {definst @ (@ \&key @) (@^*) \\ \ind + @[[ @^* @! @ @]] \\ + @^* \- + \nlret @} \end{describe} \begin{describe}{mac} - {format-compound-statement (@ @ \&optional @) - @^*} + {format-compound-statement + (@ @ \&optional @) \\ \ind + @^* \\ + @^*} \end{describe} \begin{table} @@ -895,8 +904,10 @@ Temporary names are represented by objects which implement a simple protocol. \end{describe} \begin{describe}{mac} - {with-temporary-var (@ @ @) @^* - @> @^*} + {with-temporary-var (@ @ @) \\ \ind + @^* \\ + @^* \- + \nlret @^*} \end{describe} \begin{describe}{fun}{deliver-expr @ @ @} diff --git a/doc/lispintro.tex b/doc/lispintro.tex index 5f1043f..dc1cab1 100644 --- a/doc/lispintro.tex +++ b/doc/lispintro.tex @@ -157,11 +157,12 @@ category (function, class, macro, etc.) on the right. \end{quote} \end{describe} -\begin{describe}{mac}{example-macro - ( @{ @ @! (@ @) @}^* ) \\ \ind - @[[ @^* @! @ @]] \\ - @^* - \nlret @^*} +\begin{describe}{mac} + {example-macro + (@{ @ @! (@ @) @}^*) \\ \ind + @[[ @^* @! @ @]] \\ + @^* + \nlret @^*} The synopsis for a macro describes the acceptable syntax using the following notation. \begin{itemize} diff --git a/doc/misc.tex b/doc/misc.tex index de62c8e..92223d1 100644 --- a/doc/misc.tex +++ b/doc/misc.tex @@ -32,17 +32,20 @@ These symbols are defined in the @|sod-utilities| package. \begin{describe}{mac} {with-gensyms (@{ @ @! (@ @[@@]) @}^*) \\ \ind - @^*} + @^* \\ + @^*} \end{describe} \begin{describe}{mac} {once-only (@[[ :environment @ @]] @{ @ @! (@ @[@@]) @}^*) \\ \ind - @^*} + @^* \\ + @^*} \end{describe} \begin{describe}{mac} - {parse-body @ @> @ @ @} + {parse-body @ \&key :docp :declp + @> @ @ @} \end{describe} \begin{describe}{cls}{loc} @@ -51,7 +54,7 @@ These symbols are defined in the @|sod-utilities| package. \begin{describe}{fun}{locp @ @> @} \end{describe} -\begin{describe}{macro}{locf @ @> @} +\begin{describe}{mac}{locf @ @> @} \end{describe} \begin{describe*} @@ -63,7 +66,8 @@ These symbols are defined in the @|sod-utilities| package. {with-locatives @{ @ @! (@{ @ @! (@ @[@@]) @}^*) @} \\ \ind - @^*} + @^* \\ + @^*} \end{describe} \begin{describe}{sym}{it} @@ -72,7 +76,7 @@ These symbols are defined in the @|sod-utilities| package. \begin{describe}{mac}{aif @ @ @[@@]} \end{describe} -\begin{describe}{mac}{awhen @ @^*} +\begin{describe}{mac}{awhen @ @^*} \end{describe} \begin{describe}{mac}{acond @{ (@ @^*) @}^*} @@ -136,7 +140,8 @@ These symbols are defined in the @|sod-utilities| package. {categorize (\=@ @ @[[ :bind (@{ @ @! (@ @[@@]) @}^*) @]]) \\ \ind\ind - (@{ @ @ @}^*) \- \\ + (@{ (@ @) @}^*) \- \\ + @^* \\ @^* \- \nlret @^*} \end{describe} @@ -170,14 +175,16 @@ These symbols are defined in the @|sod-utilities| package. {maybe-print-unreadable-object (@ @ @[[ :type @ @! :identity @ @]]) \\ \ind - @^*} + @^* \\ + @^*} \end{describe} \begin{describe}{mac} {dosequence (@ @ @[[ :start @ @! :end @ @! :indexvar @ @]]) \\ \ind - @{ @ @! @ @}^*} + @^* \\ + @{ @ @! @ @}^*} \end{describe} \begin{describe}{mac} @@ -187,12 +194,13 @@ These symbols are defined in the @|sod-utilities| package. \begin{describe}{mac} {default-slot (@ @ @[@@]) \\ \ind - @^*} + @^*} \end{describe} \begin{describe}{mac} {define-on-demand-slot @ @ (@) \\ \ind - @^*} + @[[ @^* @! @ @]] \\ + @^*} \end{describe} %%%-------------------------------------------------------------------------- @@ -307,15 +315,16 @@ These symbols are defined in the @!optparse| package. \begin{describe}{fun}{option-parse-next @} \end{describe} -\begin{describe}{mac}{option-parse-try @^*} +\begin{describe}{mac}{option-parse-try @^*} \end{describe} -\begin{describe}{mac}{with-unix-error-reporting () @^*} +\begin{describe}{mac}{with-unix-error-reporting () @^*} \end{describe} \begin{describe}{mac} {defopthandler @ (@ @[@@]) @ \\ \ind - @^*} + @[[ @^* @! @ @]] \\ + @^*} \end{describe} \begin{describe}{fun} @@ -349,7 +358,10 @@ These symbols are defined in the @!optparse| package. \begin{describe}{opt}{list \&optional @ \&rest @} \end{describe} -\begin{describe}{mac}{defoptmacro @ @ @^*} +\begin{describe}{mac} + {defoptmacro @ @ \\ \ind + @[[ @^* @! @ @]] \\ + @^*} \end{describe} \begin{describe}{fun}{parse-option-form @} @@ -366,7 +378,8 @@ These symbols are defined in the @!optparse| package. (:opt-arg @) @! \\ @ @! (:tag @) @! (:negated-tag @) @! \\ - @{ (@ @ @^*) @}^* @]]) @}^*} + @{ (@ @ @^*) @}^* + @]]) @}^*} \end{describe} \begin{describe}{fun} @@ -468,7 +481,8 @@ These symbols are defined in the @!optparse| package. \begin{describe}{fun}{pset-map @ @} \end{describe} -\begin{describe}{mac}{with-pset-iterator (@ @) @^*} +\begin{describe}{mac} + {with-pset-iterator (@ @) @^* @^*} \end{describe} \begin{describe}{fun} @@ -499,6 +513,7 @@ These symbols are defined in the @!optparse| package. {default-slot-from-property (@ @ @[@@]) \\ \ind\ind (@ @ @ @[@ @^*@]) \- \\ + @^* \\ @^*} \end{describe} diff --git a/doc/parsing.tex b/doc/parsing.tex index 58959c0..2bf9105 100644 --- a/doc/parsing.tex +++ b/doc/parsing.tex @@ -124,11 +124,12 @@ consumed any input items. \end{describe*} \begin{describe}{mac} - {with-default-error-location (@) @^* @> @^*} + {with-default-error-location (@) @^* @^* + @> @^*} \end{describe} \begin{describe}{mac} - {count-and-report-errors () @^* + {count-and-report-errors () @^* @^* @> @ @ @} \end{describe} @@ -209,7 +210,8 @@ the scanner and read that data again. Therefore it's possible to \end{describe} \begin{describe}{mac} - {with-scanner-place (@ @) @^* @> @^*} + {with-scanner-place (@ @) @^* @^* + @> @^*} Capture the @'s current position as a place, evaluate the @s as an implicit progn with the variable @ bound to the captured place. When control leaves the @s, the place is released. The return @@ -446,14 +448,16 @@ file-location protocols. \begin{describe}{mac} {defparse @ (@[[ :context (@ @) @]] @^*) \\ \ind - @^* \- + @[[ @^* @! @ @]] \\ + @^* \- \nlret @} \end{describe} \begin{describe}{mac} {with-parser-context (@ @{ @ @ @}^*) \\ \ind - @^* \- + @^* \\ + @^* \- \nlret @^*} \end{describe} @@ -482,7 +486,7 @@ file-location protocols. \begin{describe}{mac} {when-parse (@[@@]) @ \\ \ind - @^* \- + @^* \- \nlret @^*} \end{describe} @@ -563,7 +567,9 @@ file-location protocols. \end{describe} \begin{describe}{mac} - {define-pluggable-parser @ @ @ @^*} + {define-pluggable-parser @ @ @ + @[[ @^* @! @ @]] + @^*} \end{describe} \begin{describe}{gf}{parser-capture-place @ @> @} @@ -580,7 +586,9 @@ file-location protocols. \end{describe} \begin{describe}{mac} - {with-parser-place (@ @) @^*} + {with-parser-place (@ @) + @[[ @^* @! @ @]] + @^*} \end{describe} \begin{describe}{parseform}{peek @} @@ -704,14 +712,14 @@ file-location protocols. \begin{describe*} {\dhead{mac}{preop @ (@ @) - @^* + @^* @^* @> @} \dhead{mac}{postop @ (@ @ @[[ :rprec @ @]]) - @^* - @> @} + @^* @^* + \nlret @} \dhead{mac}{binop @ (@ @ @ @) - @^* + @^*@^* @> @}} \end{describe*} -- 2.11.0