is_class_member

Gamma: Version 4.0
Prev |  | Next

# `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

| 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`

Prev | Home | Next
`instance_vars` | Up | `ivar_type`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.