instance_vars
instance_vars — finds all the instance variables of a class or
instance.
instance_vars (instance|class)
instance|classAn instance of a class, or a class.
An array of all instance variables defined for the given
instance or class. If an
instance is queried, then the values of all instance variables for that
instance are also reported.
Queries the instance variables of a class or instance.
![]() | |
This example is based on the class and method developed in |
Gamma>polyD;{RegPolygon (length) (sides)}Gamma>sqB;{Square (length) (sides . 4)}Gamma>instance_vars(RegPolygon);[length sides]Gamma>instance_vars(polyD);[(length) (sides)]Gamma>instance_vars(Square);[length (sides . 4)]Gamma>instance_vars(sqB);[(length) (sides . 4)]Gamma>