class_of

class_of — gives the class definition of a given instance.

Syntax

class_of (instance)

		

Arguments

instance

An instance of a class.

Returns

The class of the instance.

Description

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).

Example

[Note]

This example is based on the class and method developed in method.

Gamma> class_of(sqB);
(defclass Square RegPolygon [(area . (defun Square.area (self) (sqr (@ self length))))][length (sides . 4)])
Gamma> 
		

See Also

class_name