Go to the
first,
previous,
next,
last section,
table of contents.
Previously, a :NEW message was used to create an object. The message
used to see what is in an object is the :SHOW message.
________________________________________________________________
|
| > (send my-class :show)
| Object is #<Object: #27756>, Class is #<Object: #23fe2>
| MESSAGES = NIL
| IVARS = NIL
| CVARS = NIL
| CVALS = NIL
| SUPERCLASS = #<Object: #23fd8>
| IVARCNT = 0
| IVARTOTAL = 0
| #<Object: #27756>
|________________________________________________________________
From the display of the MY-CLASS object you can see there are a variety
of components. The components of a class are:
- Class Pointer
-
This pointer shows to what class the object (instance or class) belongs.
For a class, this always points to the built-in object CLASS. This is
also true of the CLASS object, its class pointer points to itself.
- Superclass Pointer
-
This pointer shows what the next class up the class hierarchy is. If
the user does not specify what class is the superclass, it will point to
the built-in class OBJECT.
- Messages
-
This component shows what messages are allowed for the class, and the
description of the method that will be used. If the method is
system-defined, it will show up in the form of '#<Subr-: #18b98>'.
Remember that the class hierarchy (through the Superclass Pointer) is
searched if the requested message is not found in the class.
- Instance Variables
-
This component lists what instance variables will be created when an
object instance is created. If no instances of the class exist, there
are no Instance Variables. If there are 5 instances of a class, there
are 5 complete and different groups of the Instance Variables.
- Class Variables and Values
-
The CLASS VARIABLES (CVAR) component lists what class variables exist
within the class. The Class Values (CVAL) component shows what the
current values of the variables are. Class Variables are used to hold
state information about a class. There will be one of each of the
Class Variables, independent of the number of instances of the class
created.
Go to the
first,
previous,
next,
last section,
table of contents.