destroy

destroy --  destroys a class instance.

Syntax

destroy (instance)

		

Arguments

instance

An instance of any class.

Returns

t when successful, else error.

Description

This function destroys instances of classes. When a class instance is destroyed, its data type changes to destroyed instance. You can test for a destroyed instance by using the predicate destroyed_p.

Example

    Gamma> class RegPolygon{sides; length;}
    (defclass RegPolygon nil [][length sides])
    Gamma> polyA = new(RegPolygon);
    {RegPolygon (length) (sides)}
    Gamma> destroy (polyA);
    t
    Gamma> polyA;
    #<Destroyed Instance>
    Gamma> destroyed_p(polyA);
    t
    Gamma>  
    		

See Also

class, new

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