The monadic system function ŒEX causes named objects to be erased. See also )ERASE.
The right argument is a character vector (for a single name) or matrix of names. Expunge returns a vector of numbers in which 1 indicates successful erasure, 0 non-erasure:
)VARS
DATA RESULT
)FNS
AVERAGE MEAN SD
ŒEX ŒBOX 'MEAN STANDARD DATA'
1 0 1
)VARS
RESULT
)FNS
AVERAGE SD
Local objects are expunged if both local and global objects of the same name exist. This contrasts with )ERASE which erases the global version.
ŒEX can be used to erase a class definition (and all the methods and properties defined in it). Any instances of the class will become instances of the erased class's parent, if there is one, or of the NULL class, if the erased class did not have a parent. Similarly, any classes which inherited from the erased class will be re-parented so that they now inherit from the erased class's parent.
In this example, class POINT3D inherits from COLOR_POINT which in turn inherits from POINT. PT is an instance of COLOR_POINT:
)CLASSES
COLOR_POINT POINT POINT3D
ŒCLASS POINT3D
{POINT3D} {COLOR_POINT} {POINT}
PT„ŒNEW COLOR_POINT
PT.ŒCLASSNAME
COLOR_POINT
If we erase the class COLOR_POINT, its child class POINT3D is re-parented. The instance PT becomes an instance of the original parent:
ŒEX 'COLOR_POINT'
1
ŒCLASS POINT3D
{POINT3D} {POINT}
PT.ŒCLASSNAME
POINT
If we now erase the class POINT, POINT3D will now have no parent, and the instance PT becomes an instance of the NULL class:
ŒEX 'POINT'
1
PT.ŒCLASSNAME
NULL
ŒCLASS POINT3D
{POINT3D}