+++ /dev/null
-\documentclass{article}
-
-\usepackage{tikz}
-\usetikzlibrary{shapes.geometric}
-\usetikzlibrary{arrows}
-
-\begin{document}
-
-\begin{tikzpicture}
- \begin{scope}[minimum width=8em,minimum height=3ex]
- \node[draw,rectangle] (eql) at (0,0) {\texttt{eql-specializer}};
- \node[draw,rectangle] (class) at (1,2) {\texttt{class}};
- \node[draw,rectangle] (specializer) at (0.5,6) {\texttt{specializer}};
- \node[draw,ellipse] (argument) at (7,2) {\textit{argument}};
-
- \node[draw,red,ellipse] (generalizer) at (7,4) {\textit{\color{red}generalizer}};
- \node[draw,red,rectangle] (genspec) at (2,4) {\texttt{\color{red}gen.-spec.}};
- \end{scope}
-
- \draw[->,>=open triangle 60] (eql.168) |- (specializer);
- \draw[->,>=open triangle 60] (class.160) -- (class.160 |- specializer.south);
- \draw[->,>=open triangle 60,red] (genspec.150) -- (genspec.150 |- specializer.south);
-
- \draw[dashed] (argument.south) |- node[right,near start] {\texttt{eql}} node[below,near end] {\texttt{eql-specializer-object}} (eql.east);
- \draw[dashed] (argument.west) -- node[below] {\texttt{typep}} node[above] {\texttt{class-of}} (class.east);
- \draw[red] (argument.north) -- node[right] {\texttt{\color{red}generalizer-of}} (generalizer.south);
- \draw[red] (generalizer.west) -- node[above] (sagp) {\texttt{\color{red}s-a-g-p}} (genspec.east);
- \node (specaccgenp) at (6,5.5) {\texttt{\footnotesize{\color{red}specializer-accepts-generalizer-p}}};
- \draw[red,dotted] (sagp) -- (specaccgenp);
-
-\end{tikzpicture}
-
-\end{document}
\ No newline at end of file
incorporating substantial fractions of the Metaobject Protocol as
described.
+ #+CAPTION: MOP Design Space
+ #+LABEL: fig:mopdesign
+ #+ATTR_LATEX: width=\linewidth float
+ [[file:figures/mop-design-space.pdf]]
+
Although it has stood the test of time, the CLOS MOP is neither
without issues (e.g. semantic problems with =make-method-lambda=
\cite{Costanza.Herzeel:2008}; useful functions such as
implement all conceivable variations of object-oriented behaviour.
While metaprogramming offers some possibilities for customization of
the object system behaviour, those possibilities cannot extend
- arbitrarily in all directions. There is still an expectation that
- functionality is implemented with methods on generic functions,
- acting on objects with slots; it is not possible, for example, to
- transparently implement support for “message not understood” as in
- the message-passing paradigm, because the analogue of messages
- (generic functions) need to be defined before they are used.
+ arbitrarily in all directions (conceptually, if a given object
+ system is a point in design space, then a MOP for that object system
+ allows exploration of a region of design space around that point;
+ see figure \ref{fig:mopdesign}). In the case of the CLOS MOP, there is
+ still an expectation that functionality is implemented with methods
+ on generic functions, acting on objects with slots; it is not
+ possible, for example, to transparently implement support for
+ “message not understood” as in the message-passing paradigm, because
+ the analogue of messages (generic functions) need to be defined
+ before they are used.
Nevertheless, the MOP is flexible, and is used for a number of
things, including: documentation generation (where introspection in
symbols); and programmatic construction of metaobjects, for example
for IDL compilers and model transformations.
- [ XXX: A picture on MOP flexibility here would be good; I have in my mind
- one where an object system is a point and the MOP opens up a blob
- around that point, and I'm sure I've seen it somewhere but I can't
- remember where. Alternatively, there's Kiczales et al "MOPs: why we
- want them and what else they can do", fig. 2 ]
- [AMOP, page 5] paints that picture, but again, only using words :)
-
One area of functionality where there is scope for customization by
the metaprogrammer is in the mechanics and semantics of method
applicability and dispatch. While in principle AMOP allows
#+CAPTION: Dispatch Comparison
#+LABEL: fig:dispatch
- #+ATTR_LATEX: width=0.9\linewidth float
- [[file:figures/dispatch-comparison.pdf]]
+ #+ATTR_LATEX: width=\linewidth float
+ [[file:figures/dispatch-relationships.pdf]]
The remaining sections in this paper can be read in any order. We
give some motivating examples in section [[#Examples]], including
required arguments in a list to use as a key in an =equal=
hash-table.
- [XXX could we actually compute a suitable hash key using the
+#+begin_comment
+ [could we actually compute a suitable hash key using the
generalizer's class name and initargs?]
+#+end_comment
*** COMMENT
- [X] =generalizer-of-using-class= (NB class of gf not class of object)
--- /dev/null
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usetikzlibrary{shapes.geometric}
+\usetikzlibrary{arrows}
+
+\begin{document}
+
+\begin{tikzpicture}
+ \begin{scope}[minimum width=8em,minimum height=3ex]
+ \node[draw,rectangle] (eql) at (0,0) {\texttt{eql-specializer}};
+ \node[draw,rectangle] (class) at (1,2) {\texttt{class}};
+ \node[draw,rectangle] (specializer) at (0.5,6) {\texttt{specializer}};
+ \node[draw,ellipse] (argument) at (7,2) {\textit{argument}};
+
+ \node[draw,red,ellipse] (generalizer) at (7,4) {\textit{\color{red}generalizer}};
+ \node[draw,red,rectangle] (genspec) at (2,4) {\texttt{\color{red}gen.-spec.}};
+ \end{scope}
+
+ \draw[->,>=open triangle 60] (eql.168) |- (specializer);
+ \draw[->,>=open triangle 60] (class.160) -- (class.160 |- specializer.south);
+ \draw[->,>=open triangle 60,red] (genspec.150) -- (genspec.150 |- specializer.south);
+
+ \draw[dashed] (argument.south) |- node[right,near start] {\texttt{eql}} node[below,near end] {\texttt{eql-specializer-object}} (eql.east);
+ \draw[dashed] (argument.west) -- node[below] {\texttt{subtypep}} node[above] {\texttt{class-of}} (class.east);
+ \draw[red] (argument.north) -- node[right] {\texttt{\color{red}generalizer-of}} (generalizer.south);
+ \draw[red] (generalizer.west) -- node[above] (sagp) {\texttt{\color{red}s-a-g-p}} (genspec.east);
+ \node (specaccgenp) at (6,5.5) {\texttt{\footnotesize{\color{red}specializer-accepts-generalizer-p}}};
+ \draw[red,dotted] (sagp) -- (specaccgenp);
+
+\end{tikzpicture}
+
+\end{document}
\ No newline at end of file
--- /dev/null
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usetikzlibrary{shapes.symbols}
+\usetikzlibrary{arrows}
+\usetikzlibrary{calc}
+
+\begin{document}
+
+\begin{tikzpicture}[>=stealth]
+ \draw [->] (0,0) -- (0,5);
+ \draw [->] (0,0) -- (5,0);
+ \draw [->] (0,0) -- (0,0,5);
+
+ \node[draw,red,cloud,minimum height=2cm,minimum width=2cm] (mop) at (3,4,3) {$\color{black}\bullet$};
+
+ \node (os) at (2.5,2,3) {object system};
+ \draw (os) -- (mop.center);
+
+ \node[red] (mspace) at (5,6,3) {MOP space};
+ \draw[red] (mspace) -- (mop);
+\end{tikzpicture}
+
+\end{document}
\ No newline at end of file