class_of
class_of — gives the class definition of a given instance.
class_of (instance)
instanceAn instance of a class.
The class of the instance.
This function returns the class definition of the
instance. If the instance
belongs to a derived class, the most precise class definition is returned
(the class which was used to create the instance through a call to
new).
![]() | |
This example is based on the class and method developed in |
Gamma>class_of(sqB);(defclass Square RegPolygon [(area . (defun Square.area (self) (sqr (@ self length))))][length (sides . 4)])Gamma>