X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/7c3f8ae64cac1e7459033418f6116dd608eb3877..b492babc8de898bd22d638d7c25f24356896a3a9:/doc/clang.tex?ds=sidebyside

diff --git a/doc/clang.tex b/doc/clang.tex
index 063c708..58b8cd2 100644
--- a/doc/clang.tex
+++ b/doc/clang.tex
@@ -120,8 +120,9 @@ type specifier.  Type specifiers fit into two syntactic categories.
 \end{describe}
 
 \begin{describe}{mac}
-    {defctype @{ @<name> @! (@<name> @<nickname>^*) @} @<type-spec>
-      @> @<names>}
+    {defctype \=@{ @<name> @! (@<name>^+) @} @<type-spec> \+ \\
+                @[[ @|:export| @<export-flag> @]]^* \-
+       \nlret @<names>}
   Defines a new symbolic type specifier @<name>; if a list of @<name>s is
   given, then all are defined in the same way.  The type constructed by using
   any of the @<name>s is as described by the type specifier @<type-spec>.
@@ -129,6 +130,13 @@ type specifier.  Type specifiers fit into two syntactic categories.
   The resulting type object is constructed once, at the time that the macro
   expansion is evaluated; the same (@|eq|) value is used each time any
   @<name> is used in a type specifier.
+
+  A variable named @|c-type-@<name>|, for the first @<name> only, is defined
+  and initialized to contain the C type object so constructed.  Altering or
+  binding this name is discouraged.
+
+  If @<export-flag> is true, then the variable name, and all of the @<name>s,
+  are exported from the current package.
 \end{describe}
 
 \begin{describe}{mac}{c-type-alias @<original> @<alias>^* @> @<aliases>}
@@ -410,13 +418,21 @@ In Sod, the leaf types are
 \end{describe}
 
 \begin{describe}{mac}
-    {define-simple-c-type @{ @<name> @! (@<name>^*) @} @<string> @> @<name>}
+    {define-simple-c-type \=@{ @<name> @! (@<name>^+) @} @<string> \+ \\
+                            @[[ @|:export| @<export-flag> @]] \-
+      \nlret @<name>}
   Define type specifiers for a new simple C type.  Each symbol @<name> is
   defined as a symbolic type specifier for the (unique interned) simple C
   type whose name is the value of @<string>.  Further, each @<name> is
   defined to be a type operator: the type specifier @|(@<name>
   @<qualifier>^*)| evaluates to the (unique interned) simple C type whose
   name is @<string> and which has the @<qualifiers> (which are evaluated).
+
+  Furthermore, a variable @|c-type-@<name>| is defined, for the first @<name>
+  only, and initialized with the newly constructed C type object.
+
+  If @<export-flag> is true, then the @|c-type-@<name>| variable name, and
+  all of the @<name>s, are exported from the current package.
 \end{describe}
 
 \begin{describe}{cls}{tagged-c-type (qualifiable-c-type)
@@ -668,14 +684,19 @@ function type is the type of the function's return value.
   in the same order, and either both or neither argument list ends with
   @|:ellipsis|; argument names are not compared.
 
-  The type specifier @|(fun @<return-type> @{ (@<arg-name> @<arg-type>) @}^*
-  @[:ellipsis @! . @<form> @])| constructs a function type.  The function has
-  the subtype @<return-type>.  The remaining items in the type-specifier list
-  are used to construct the argument list.  The argument items are a possibly
-  improper list, beginning with zero or more \emph{explicit arguments}:
-  two-item @<arg-name>/@<arg-type> lists.  For each such list, an @|argument|
-  object is constructed with the given name (evaluated) and type.  Following
-  the explicit arguments, there may be
+  The type specifier
+  \begin{prog}
+    (fun @<return-type>
+         @{ (@<arg-name> @<arg-type>) @}^*
+         @[:ellipsis @! . @<form>@])
+  \end{prog}
+  constructs a function type.  The function has the subtype @<return-type>.
+  The remaining items in the type-specifier list are used to construct the
+  argument list.  The argument items are a possibly improper list, beginning
+  with zero or more \emph{explicit arguments}: two-item
+  @<arg-name>/@<arg-type> lists.  For each such list, an @|argument| object
+  is constructed with the given name (evaluated) and type.  Following the
+  explicit arguments, there may be
   \begin{itemize}
   \item nothing, in which case the function's argument list consists only of
     the explicit arguments;
@@ -883,12 +904,7 @@ Temporary names are represented by objects which implement a simple protocol.
     @|expr|     & @<expr>                  & @<expr>;           \\ \hlx{v}
     @|call|     & @<func> @<args>          & @<func>(@<arg>_1,
                                                      $\ldots$,
-                                                     @<arg>_n)  \\ \hlx{v}
-    @|va-start| & @<ap> @<arg>             & va_start(@<ap>, @<arg>);
-                                                                \\ \hlx{v}
-    @|va-copy|  & @<to> @<from>            & va_copy(@<to>, @<from>);
-                                                                \\ \hlx{v}
-    @|va-end|   & @<ap>                    & va_end(@<ap>);     \\ \hlx{vhv}
+                                                     @<arg>_n)  \\ \hlx{vhv}
     @|block|    & @<decls> @<body>         & \{ @[@<decls>@] @<body> \}
                                                                 \\ \hlx{v}
     @|if|       & @<cond> @<conseq> @<alt> & if (@<cond>) @<conseq>
@@ -961,6 +977,10 @@ Temporary names are represented by objects which implement a simple protocol.
 \begin{describe}{fun}{deliver-expr @<codegen> @<target> @<expr>}
 \end{describe}
 
+\begin{describe}{fun}
+    {deliver-call @<codegen> @<target> @<func> \&rest @<args>}
+\end{describe}
+
 \begin{describe}{fun}{convert-stmts @<codegen> @<target> @<type> @<func>}
 \end{describe}
 
