next up previous contents
Next: B. Notifications Up: A. The VLISP object Previous: A. The VLISP object

A1. The Definition of a Class

VLISP allows the definition of classes of objects using the syntax of Description A.1. The newly defined class class-name inherits all properties from super-class.


\begin{Modeldesc}
% latex2html id marker 10587
\caption{
The newly defined class...
...\>\textsl{default}) \} \end{tabbing}\end{minipage}\end{flushleft}\end{Modeldesc}

Example A.1 illustrates the usage of these classes within VLISP. It defines a generic flower-class which owns one instance variable color. Aside from the constructor :isnew which initializes the color variable, the flower-class has two methods :sort-of-flower and :introduce-yourself returning the sort name of the flower and issuing an introduction output, respectively.

The rose-class and the edelweiss-class are customized by overloading the original :sort-of-flower method such that these methods return "rose", and "edelweiss", respectively. At lines 41, 43, 45 we can see how this affects their introduction output.


\begin{Example}
% latex2html id marker 10434\centering\scriptsize
\begin{minip...
... by
classes which are sub-classed from the \texttt{flower-class}.}
\end{Example}



Rudi Strasser
1999-05-27