From 020b9e2b4364c61a668d47c4c5405295349817d8 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] doc/: Align layout control commands to right margin in `tabbing' etc. This is mostly clean in `--word-diff'. Here are the exceptions. * doc/parsing.tex: `--word-diff' gets confused around the various `condition-with-location' subclasses. This is clean in `-b', so there's not actually anything complicated happening here. * doc/parsing.tex: I've sneakily removed a pointless trailing `%'. * doc/runtime.tex: I've inserted a couple of linebreaks with `%' so as to shorten the source-file lines. * doc/runtime.tex: Some `\-' have harmlessly moved past `@\\' macro- backslashes to take their proper places on the right margin. --- doc/clang.tex | 77 +++++++++++------------ doc/concepts.tex | 24 ++++---- doc/layout.tex | 24 ++++---- doc/lispintro.tex | 4 +- doc/meta.tex | 22 ++++--- doc/misc.tex | 51 +++++++-------- doc/output.tex | 4 +- doc/parsing.tex | 86 +++++++++++++------------- doc/runtime.tex | 78 +++++++++++------------ doc/structures.tex | 178 +++++++++++++++++++++++++++-------------------------- doc/syntax.tex | 30 ++++----- doc/tutorial.tex | 66 ++++++++++---------- 12 files changed, 329 insertions(+), 315 deletions(-) diff --git a/doc/clang.tex b/doc/clang.tex index 0c6c4bb..c4a6a53 100644 --- a/doc/clang.tex +++ b/doc/clang.tex @@ -38,19 +38,19 @@ The class hierarchy is shown in~\xref{fig:codegen.c-types.classes}. \begin{figure} \centering \parbox{10pt}{\begin{tabbing} - @|c-type| \\ \ind - @|qualifiable-c-type| \\ \ind - @|simple-c-type| \\ \ind - @|c-class-type| \- \\ - @|tagged-c-type| \\ \ind - @|c-struct-type| \\ - @|c-union-type| \\ - @|c-enum-type| \- \\ - @|c-atomic-type| \\ - @|c-pointer-type| \- \\ - @|c-array-type| \\ - @|c-function-type| \\ \ind - @|c-keyword-function-type| \- + @|c-type| \\ \ind + @|qualifiable-c-type| \\ \ind + @|simple-c-type| \\ \ind + @|c-class-type| \-\\ + @|tagged-c-type| \\ \ind + @|c-struct-type| \\ + @|c-union-type| \\ + @|c-enum-type| \-\\ + @|c-atomic-type| \\ + @|c-pointer-type| \-\\ + @|c-array-type| \\ + @|c-function-type| \\ \ind + @|c-keyword-function-type| \- \end{tabbing}} \caption{Classes representing C types} \label{fig:codegen.c-types.classes} @@ -125,9 +125,9 @@ type specifier. Type specifiers fit into two syntactic categories. \end{describe} \begin{describe}{mac} - {defctype \=@{ @ @! (@^+) @} @ \+ \\ - @[[ @|:export| @ @]]^* \- - \nlret @} + {defctype \=@{ @ @! (@^+) @} @ \+\\ + @[[ @|:export| @ @]]^* + \-\nlret @} Defines a new symbolic type specifier @; if a list of @s is given, then all are defined in the same way. The type constructed by using any of the @s is as described by the type specifier @. @@ -151,10 +151,10 @@ type specifier. Type specifiers fit into two syntactic categories. \end{describe} \begin{describe}{mac} - {define-c-type-syntax @ @ \\ \ind - @[[ @^* @! @ @]] \\ - @
^* \- - \nlret @} + {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 @@ -564,9 +564,10 @@ In Sod, the leaf types are \end{describe} \begin{describe}{mac} - {define-simple-c-type \=@{ @ @! (@^+) @} @ \+ \\ - @[[ @|:export| @ @]] \- - \nlret @} + {define-simple-c-type + \=@{ @ @! (@^+) @} @ \+\\ + @[[ @|:export| @ @]] + \-\nlret @} Define type specifiers for a new simple C type. Each symbol @ is defined as a symbolic type specifier for the (unique interned) simple C type whose name is the value of @. Further, each @ is @@ -903,15 +904,15 @@ function type is the type of the function's return value. For example, \begin{prog} - (c-type (fun \=(lisp (c-type-subtype other-func)) \+ \\ + (c-type (fun \=(lisp (c-type-subtype other-func)) \+\\ ("first" int) . (c-function-arguments other-func)) \end{prog} evaluates to a function type like @|other-func|, only with an additional argument of type @|int| added to the front of its argument list. This could also have been written \begin{prog} - (let (\=(args (c-function-arguments other-func)) \+ \\ - (ret (c-type-subtype other-func))) \- \\ \ind + (let (\=(args (c-function-arguments other-func)) \+\\ + (ret (c-type-subtype other-func))) \-\\ \ind (c-type (fun \=(lisp ret) ("first" int) . args) \end{prog} \end{describe} @@ -948,9 +949,9 @@ function type is the type of the function's return value. follows. \begin{prog} (fun \=@ - @{ (@ @) @}^* \+ \\ + @{ (@ @) @}^* \+\\ @{ \=:keys @{ (@ @ @[@@]) @}^* - @[. @@] @! \+ \\ + @[. @@] @! \+\\ . @ @} \end{prog} where either the symbol @|:keys| appears literally in the specifier, or the @@ -1187,16 +1188,16 @@ Temporary names are represented by objects which implement a simple protocol. \end{describe} \begin{describe}{mac} - {definst @ (@ \&key @) (@^*) \\ \ind - @[[ @^* @! @ @]] \\ - @^* \- - \nlret @} + {definst @ (@ \&key @) (@^*) \\ \ind + @[[ @^* @! @ @]] \\ + @^* + \-\nlret @} \end{describe} \begin{describe}{mac} {format-compound-statement - (@ @ \&optional @) \\ \ind - @^* \\ + (@ @ \&optional @) \\ \ind + @^* \\ @^*} \end{describe} @@ -1302,10 +1303,10 @@ Temporary names are represented by objects which implement a simple protocol. \end{describe} \begin{describe}{mac} - {with-temporary-var (@ @ @) \\ \ind - @^* \\ - @^* \- - \nlret @^*} + {with-temporary-var (@ @ @) \\ \ind + @^* \\ + @^* + \-\nlret @^*} \end{describe} \begin{describe}{fun}{deliver-expr @ @ @} diff --git a/doc/concepts.tex b/doc/concepts.tex index 30c6735..b4e80ca 100644 --- a/doc/concepts.tex +++ b/doc/concepts.tex @@ -704,7 +704,7 @@ the platform's strictest alignment requirement applies. The following simple function correctly allocates and returns space for an instance of a class given a pointer to its class object @. \begin{prog} - void *allocate_instance(const SodClass *cls) \\ \ind + void *allocate_instance(const SodClass *cls) \\ \ind \{ return malloc(cls@->cls.initsz); \} \end{prog} @@ -728,7 +728,7 @@ of any use unless they've been written specifically for the purpose. The following simple function imprints storage at address @

as an instance of a class, given a pointer to its class object @. \begin{prog} - void imprint_instance(const SodClass *cls, void *p) \\ \ind + void imprint_instance(const SodClass *cls, void *p) \\ \ind \{ cls@->cls.imprint(p); \} \end{prog} @@ -853,16 +853,16 @@ program may be in an inconsistent state and should not continue. This simple protocol can be used, for example, to implement a reference counting system, as follows. \begin{prog} - [nick = ref] \\ - class ReferenceCountedObject \{ \\ \ind - unsigned nref = 1; \\- - void inc() \{ me@->ref.nref++; \} \\- - [role = around] \\ - int obj.teardown() \\ - \{ \\ \ind - if (--\,--me@->ref.nref) return (1); \\ - else return (CALL_NEXT_METHOD); \- \\ - \} \- \\ + [nick = ref] \\ + class ReferenceCountedObject \{ \\ \ind + unsigned nref = 1; \\- + void inc() \{ me@->ref.nref++; \} \\- + [role = around] \\ + int obj.teardown() \\ + \{ \\ \ind + if (--\,--me@->ref.nref) return (1); \\ + else return (CALL_NEXT_METHOD); \-\\ + \} \-\\ \} \end{prog} diff --git a/doc/layout.tex b/doc/layout.tex index 7a82634..cbc7cd0 100644 --- a/doc/layout.tex +++ b/doc/layout.tex @@ -301,7 +301,7 @@ \begin{describe}{cls} - {method-codegen (codegen) \\ \ind + {method-codegen (codegen) \\ \ind \&key :vars :insts :temp-index :message :class :method :target} \end{describe} @@ -372,17 +372,17 @@ \end{describe} \begin{describe}{cls} - {daemon-direct-method (basic-direct-method) \\ \ind + {daemon-direct-method (basic-direct-method) \\ \ind \&key :message :location :class :type :body :role} \end{describe} \begin{describe}{cls} - {delegating-direct-method (basic-direct-method) \\ \ind + {delegating-direct-method (basic-direct-method) \\ \ind \&key :message :location :class :type :body :role} \end{describe} \begin{describe}{cls} - {basic-effective-method (effective-method) \\ \ind + {basic-effective-method (effective-method) \\ \ind \&key :message :class :around-methods :before-methods :after-methods} \end{describe} @@ -397,7 +397,7 @@ \end{describe*} \begin{describe}{cls} - {simple-effective-method (basic-effective-method) \\ \ind + {simple-effective-method (basic-effective-method) \\ \ind \&key :message :class :around-methods :before-methods :after-methods :primary-methods} \end{describe} @@ -411,7 +411,7 @@ \end{describe} \begin{describe}{cls} - {standard-effective-method (simple-effective-method) \\ \ind + {standard-effective-method (simple-effective-method) \\ \ind \&key :message :class :around-methods :before-methods :after-methods :primary-methods} \end{describe} @@ -427,7 +427,7 @@ \begin{describe}{gf} {compute-aggregating-message-kernel - \=@ @ @ \+ \\ + \=@ @ @ \+\\ @ @ \&key} \end{describe} @@ -436,21 +436,21 @@ \end{describe} \begin{describe}{cls} - {aggregating-effective-method (simple-effective-method) \\ \ind + {aggregating-effective-method (simple-effective-method) \\ \ind \&key :message :class :around-methods :before-methods :after-methods :primary-methods} \end{describe} \begin{describe}{mac} - {define-aggregating-method-combination @ \\ \ind\ind + {define-aggregating-method-combination @ \\ \ind\ind ((@^*) @[[ :codegen @ @! - :methods @ @]]) \- \\ + :methods @ @]]) \-\\ @[[ \=:properties (@{ (@{ @ @! (@[@@] @) @} @ @[@ - @[@@]@]) @}^*) @! \+ \\ - :return-type @ @! \\ + @[@@]@]) @}^*) @! \+\\ + :return-type @ @! \\ :around @ @! :first-method @ @! :method @ @]]} diff --git a/doc/lispintro.tex b/doc/lispintro.tex index 02105d0..c628a2c 100644 --- a/doc/lispintro.tex +++ b/doc/lispintro.tex @@ -183,8 +183,8 @@ category (function, class, macro, etc.) on the right. \begin{describe}{mac} {example-macro - (@{ @ @! (@ @) @}^*) \\ \ind - @[[ @^* @! @ @]] \\ + (@{ @ @! (@ @) @}^*) \\ \ind + @[[ @^* @! @ @]] \\ @^* \nlret @^*} The synopsis for a macro describes the acceptable syntax using the diff --git a/doc/meta.tex b/doc/meta.tex index 6707c42..bbe1964 100644 --- a/doc/meta.tex +++ b/doc/meta.tex @@ -29,11 +29,11 @@ \section{Base metaobject classes} \label{sec:meta.classes} \begin{describe}{cls} - {sod-class () \\ \ind - \&key \=:name :nick :location :pset \+ \\ - :superclasses :link :metaclass \\ + {sod-class () \\ \ind + \&key \=:name :nick :location :pset \+\\ + :superclasses :link :metaclass \\ :slots :instance-initializers :class-initializers \\ - :initargs :initfrags :tearfrags \\ + :initargs :initfrags :tearfrags \\ :messages :methods} \end{describe} @@ -125,7 +125,7 @@ \end{describe} \begin{describe}{cls} - {sod-class-slot (sod-slot) \\ \ind + {sod-class-slot (sod-slot) \\ \ind \&key :name :location :pset :class :type :initializer-function :prepare-function} \end{describe} @@ -252,15 +252,17 @@ \end{describe*} \begin{describe}{gf} - {make-sod-method \=@ @ @ @ @ \+ \\ - @ \&optional @ \- + {make-sod-method + \=@ @ @ @ @ \+\\ + @ \&optional @ \- \nlret @} \end{describe} \begin{describe}{gf} - {make-sod-method-using-message \=@ @ - @ @ \+ \\ - @ \&optional @ \- + {make-sod-method-using-message + \=@ @ + @ @ \+\\ + @ \&optional @ \- \nlret @} \end{describe} diff --git a/doc/misc.tex b/doc/misc.tex index dce192e..5bf3e18 100644 --- a/doc/misc.tex +++ b/doc/misc.tex @@ -31,15 +31,15 @@ These symbols are defined in the @|sod-utilities| package. \begin{describe}{mac} - {with-gensyms (@{ @ @! (@ @[@@]) @}^*) \\ \ind - @^* \\ + {with-gensyms (@{ @ @! (@ @[@@]) @}^*) \\ \ind + @^* \\ @^*} \end{describe} \begin{describe}{mac} {once-only (@[[ :environment @ @]] - @{ @ @! (@ @[@@]) @}^*) \\ \ind - @^* \\ + @{ @ @! (@ @[@@]) @}^*) \\ \ind + @^* \\ @^*} \end{describe} @@ -65,8 +65,8 @@ These symbols are defined in the @|sod-utilities| package. \begin{describe}{mac} {with-locatives @{ @ @! (@{ @ @! - (@ @[@@]) @}^*) @} \\ \ind - @^* \\ + (@ @[@@]) @}^*) @} \\ \ind + @^* \\ @^*} \end{describe} @@ -138,12 +138,13 @@ These symbols are defined in the @|sod-utilities| package. \begin{describe}{mac} {categorize (\=@ @ - @[[ :bind (@{ @ @! (@ @[@@]) @}^*) @]]) - \\ \ind\ind - (@{ (@ @) @}^*) \- \\ - @^* \\ - @^* \- - \nlret @^*} + @[[ :bind (@{ @ @! + (@ @[@@]) @}^*) @]]) + \\ \ind\ind + (@{ (@ @) @}^*) \-\\ + @^* \\ + @^* + \-\nlret @^*} \end{describe} \begin{describe}{fun} @@ -172,10 +173,11 @@ These symbols are defined in the @|sod-utilities| package. \end{describe} \begin{describe}{mac} - {maybe-print-unreadable-object (@ @ - @[[ :type @ @! - :identity @ @]]) \\ \ind - @^* \\ + {maybe-print-unreadable-object + (@ @ + @[[ :type @ @! + :identity @ @]]) \\ \ind + @^* \\ @^*} \end{describe} @@ -185,8 +187,8 @@ These symbols are defined in the @|sod-utilities| package. \begin{describe}{mac} {dosequence (@ @ @[[ :start @ @! :end @ @! - :indexvar @ @]]) \\ \ind - @^* \\ + :indexvar @ @]]) \\ \ind + @^* \\ @{ @ @! @ @}^*} \end{describe} @@ -196,13 +198,13 @@ These symbols are defined in the @|sod-utilities| package. \end{describe} \begin{describe}{mac} - {default-slot (@ @ @[@@]) \\ \ind + {default-slot (@ @ @[@@]) \\ \ind @^*} \end{describe} \begin{describe}{mac} - {define-on-demand-slot @ @ (@) \\ \ind - @[[ @^* @! @ @]] \\ + {define-on-demand-slot @ @ (@) \\ \ind + @[[ @^* @! @ @]] \\ @^*} \end{describe} @@ -254,9 +256,10 @@ These symbols are defined in the @!optparse| package. \end{describe} \begin{describe}{fun} - {make-option \=@ @ \+ \\ - \&optional @ \\ - \&key :tag :negated-tag :arg-optional-p :documentation \- + {make-option \=@ @ \+\\ + \&optional @ \\ + \&key :tag :negated-tag + :arg-optional-p :documentation \- \nlret @