X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/f64eb323a5798e155cc494043f5f750abf50a482..8b8a885a8072a8e840bf99f83ef78b769121dc4a:/doc/clang.tex 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 @ @ @}