Check out the new USENIX Web site. next up previous
Next: Syntax Up: Using Accessory Functions to Previous: Dynamic Dispatch and Reuse


Accessory Functions

Although no current single-dispatch language does so, it is in principle possible to allow dynamic dispatch on a parameter other than the receiver of the message. We call a function that does so an accessory function of the class involved in dispatch. Figure 2 shows how accessory functions can be used to add a dynamically dispatched interpret function to our A.S.T. example of Figure 1 (using a notation based on C++). The rest of this section gives our design goals, and gives possible syntax and semantics for integrating accessory functions into a C++$\;$-like language.

Figure 2: Accessory Function Example
\begin{figure}
\begin{center}
\begin{verbatim}// ''pure virtual'' accessory fu...
...nterpret(p.lhs())
+ interpret(p.rhs());
}\end{verbatim}\end{center}\end{figure}

Our goal is to provide the following properties of programs written with accessory functions:



Subsections
next up previous
Next: Syntax Up: Using Accessory Functions to Previous: Dynamic Dispatch and Reuse

2000-12-09