The concrete types described in \xref{sec:structures.common} and
\ref{sec:structures.root} are declared by the header file @|<sod/sod.h>|.
-The definitions described in sections \ref{sec:structures.layout} are defined
-in the header file generated by the containing module.
+The definitions described in \xref{sec:structures.layout} are defined in the
+header file generated by the containing module.
%%%--------------------------------------------------------------------------
\section{Common instance structure} \label{sec:structures.common}
\begin{figure}[tbp]
\begin{tabular}{p{10pt}p{10pt}}
- \begin{prog}
+ \begin{nprog}
struct SodObject__ilayout \{ \\ \ind
union \{ \\ \ind
struct SodObject__ichain_obj \{ \\ \ind
\} obj; \- \\
\} obj; \- \\
\};
- \end{prog}
+ \end{nprog}
&
- \begin{prog}
+ \begin{nprog}
struct SodObject__vt_obj \{ \\ \ind
const SodClass *_class; \\
size_t _base; \- \\
\};
- \end{prog} \\
+ \end{nprog} \\
\end{tabular}
\caption{Instance and vtable layout of @|SodObject|}
\label{fig:structures.root.sodobject}
\begin{prog}
@<type>_0 $m$(@<type>_1 @<arg>_1, $\ldots$, @<type>_n @<arg>_n, \dots);
\end{prog}
+or a standard message which takes keyword arguments, defined as
+\begin{prog}
+ @<type>_0 $m$(\=@<type>_1 @<arg>_1, $\ldots$, @<type>_n @<arg>_n? \+ \\
+ @<type>_{n+1} @<kw>_{n+1} @[= @<dflt>_{n+1}@], $\ldots$,
+ @<type>_m @<kw>_m @[= @<dflt>_m@]);
+\end{prog}
two entry points are defined: the usual `main' entry point which accepts a
variable number of arguments, and a `valist' entry point which accepts an
argument of type @|va_list| in place of the variable portion of the argument
-list.
+list or keywords.
\begin{prog}
@<type>_0 $m$($C$ *me, @<type>_1 @<arg>_1, $\ldots$,
@<type>_n @<arg>_n, \dots); \\
which makes sending the message $m$ to an instance of (any subclass of) $C$
somewhat less ugly.
-If $m$ takes a variable number of arguments, the macro is more complicated
-and is only available in compilers advertising C99 support, but the effect is
-the same. For each variable-argument message, there is also an additional
-macro for calling the `valist' entry point.
+If $m$ takes a variable number of arguments, or keyword arguments, the macro
+is more complicated and is only available in compilers advertising C99
+support, but the effect is the same. For each variable-argument message,
+there is also an additional macro for calling the `valist' entry point.
\begin{prog}
\#define $C$_$m$__v(@<me>, $\ldots$, @<sod__ap>)
@<me>@->_vt@->$c$.$m$__v(@<me>, $\ldots$, @<sod__ap>)