⎕INSTANCES returns a list all the current instances of the Class specified by Y.
Y must be a reference.
If Y is a reference to a Class, R is a vector of references to all existing Class Instances of Y. Otherwise, R is empty.
This example illustrates a simple inheritance tree or Class hierarchy. There are 3 Classes, namely:
Animal Bird (derived from Animal) Parrot (derived from Bird)
:Class Animal ... :EndClass ⍝ Animal :Class Bird: Animal ... :EndClass ⍝ Bird :Class Parrot: Bird ... :EndClass ⍝ Parrot
Eeyore←⎕NEW Animal Robin←⎕NEW Bird Polly←⎕NEW Parrot ⎕INSTANCES Parrot #.[Parrot] ⎕INSTANCES Bird #.[Bird] #.[Parrot] ⎕INSTANCES Animal #.[Animal] #.[Bird] #.[Parrot]
Eeyore.⎕DF 'eeyore' Robin.⎕DF 'robin' Polly.⎕DF 'polly' ⎕INSTANCES Parrot polly ⎕INSTANCES Bird robin polly ⎕INSTANCES Animal eeyore robin polly