is_class_member

is_class_member — checks if an instance or class is a member of a class.

Syntax

is_class_member (instance|class, class)

		

Arguments

instance|class

An instance of a class; or a class.

class

A class.

Returns

t if the instance or class is a member of the class, else nil.

Description

This function checks if a given instance or class is a member (an instance or derived class) of another class.

Example

[Note]

This example is based on the classes developed in class.

Gamma> sqB = new(Square);
{Square (length) (sides . 4)}
Gamma> is_class_member(sqB, Square);
t
Gamma> is_class_member(Square, RegPolygon);
t
Gamma> is_class_member(sqB, RegPolygon);
t
Gamma> polyF = new(RegPolygon);
{RegPolygon (length) (sides)}
Gamma> is_class_member(polyF, Square);
nil
Gamma>  
		

See Also

new