APLX Help : Help on APL language : System Functions & Variables : ⎕REPARENT Change parent of user-defined class
|
|
![]() |
|
The dyadic system function The left argument is a reference to the class which you want to re-parent (or a character vector containing the name of the class). The right argument is a reference to the class which will be the new parent (or a character vector containing the new parent's name). Other than the restriction that the new parent class (the right argument) must not be descended from the class you are modifying (the left argument), there is nothing to prevent you from re-parenting a class arbitrarily. However, the main use for )CLASSES Car MotorVehicle Vehicle ⎕CLASS Car {Car} {Vehicle} ⎕CLASS MotorVehicle {MotorVehicle} {Vehicle} Car ⎕REPARENT MotorVehicle ⎕CLASS Car {Car} {MotorVehicle} {Vehicle} The 'Car' ⎕REPARENT 'MotorVehicle' Any existing instances of the class will be unaffected except that any properties which are not valid in the new version of the class (because they were inherited from the old parent but are not inherited from the new parent) will be lost. You can also re-parent a class using the )REPARENT system command, or by using the Class Editor (select Reparent Class.. from the File menu). |
|
APLX Help : Help on APL language : System Functions & Variables : ⎕REPARENT Change parent of user-defined class
|
Copyright © 1996-2010 MicroAPL Ltd