X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/edbd4fe2e21dea303553517790427e671de113bd..254bd05261479f0af6b90c6140000e23d54c691b:/doc/concepts.tex diff --git a/doc/concepts.tex b/doc/concepts.tex index 0533a68..95a0891 100644 --- a/doc/concepts.tex +++ b/doc/concepts.tex @@ -78,11 +78,11 @@ and a C value being returned to the sender. Every object is a \emph{direct instance} of exactly one \emph{class}. The class determines which slots its instances have, which messages its instances -can be sent, and which methods are invoked when those messages are received. -The Sod translator's main job is to read class definitions and convert them -into appropriate C declarations, tables, and functions. An object cannot -(usually) change its direct class, and the direct class of an object is not -affected by, for example, the static type of a pointer to it. +can be sent, and which \emph{methods} are invoked when those messages are +received. The Sod translator's main job is to read class definitions and +convert them into appropriate C declarations, tables, and functions. An +object cannot (usually) change its direct class, and the direct class of an +object is not affected by, for example, the static type of a pointer to it. If an object~$x$ is a direct instance of some class~$C$, then we say that $C$ is \emph{the class of}~$x$. Note that the class of an object is a property @@ -1072,7 +1072,14 @@ follows. initializers, \emph{and} the sender supplied a value for one or more of the corresponding effective initargs, then the value of the most specific such initarg is stored in the slot. (For this purpose, initargs defined earlier - in a class definition are more specific than initargs defined later.) + in a class definition are more specific than initargs defined + later.)\footnote{% + This is very different from the CLOS behaviour, in which a slot is + initialized from the first applicable initarg in the argument list. + Sod's keyword-argument machinery works in two stages: firstly, the + arguments values are collected into a structure on entry into an + effective method, which loses track of the order in which the arguments + were passed; and only then are the direct methods invoked.} \item Otherwise, if there are any slot initializers defined which include an initializer expression, then the initializer expression from the most