APLX Help : Help on APL language : System Commands : )ERASE Erase names
|
|
![]() |
|
Erases named global variables, functions, operators and classes from the active workspace. The command is followed by the name, or names, of the objects to be erased. If an item cannot be erased, a message to that effect is displayed. Local variables are not erased )ERASE ∆CC NEMO NOT FOUND: NEMO Indirect eraseIf one or more of the names following the )VARS A B C DATA MAT )ERASE A C )VARS B DATA MAT NAMES←⎕BOX 'B DATA' NAMES B DATA )ERASE (NAMES) (rows of NAMES interpreted as object to erase) )VARS MAT NAMES )ERASE NAMES )VARS MAT DATA←'A_NAME' )VARS DATA MAT )ERASE (DATA) (same error message as direct erase) NOT FOUND: A_NAME Erasing individual class members
PT←⎕NEW COLOR_POINT PT.⎕NL 2 ⍝ List properties of object PT COLOR X Y Z )ERASE COLOR_POINT.Z PT.⎕NL 2 ⍝ Object PT now has one less property COLOR X Y Erasing whole classes
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: )ERASE COLOR_POINT ⎕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: )ERASE POINT PT.⎕CLASSNAME NULL ⎕CLASS POINT3D {POINT3D} |
|
APLX Help : Help on APL language : System Commands : )ERASE Erase names
|
Copyright © 1996-2010 MicroAPL Ltd