## ŚCLASS Class hierarchy for object or class

Not implemented for System classes

The monadic system function ŚCLASS returns a vector of references to the class hierarchy for an object (or a class). The right argument is an object reference or a class reference. The result is a vector of class references. The first element is a reference to the class of the object (or the class itself, if the right argument was a class reference). Subsequent elements are references to successive parent classes, if any.

For example, if the class `Poem` inherits from the class `LiteraryWork`, and `Sonnet` inherits from `Poem`:

          )CLASSES
    LiteraryWork    Poem    Sonnet

           TwoLoves„ŚNEW Sonnet

           ŚCLASS Poem           © Argument is a Class reference
    {Poem} {LiteraryWork}
           ŚCLASS Sonnet
    {Sonnet} {Poem} {LiteraryWork}

           ŚCLASS TwoLoves       © Argument is an Object reference
    {Sonnet} {Poem} {LiteraryWork}
           (ŚCLASS TwoLoves).ŚCLASSNAME
     Sonnet Poem LiteraryWork

ŚCLASS can also be used for external classes. For example, the Ruby `DateTime` class inherits from `Date` which inherits from `Object`:

          DT„'ruby' ŚSETUP 'require' 'Date'
          DT„'ruby' ŚNEW 'DateTime'
          ŚCLASS DT
    {ruby:DateTime} {ruby:Date} {ruby:Object}

Topic: APLX Help : Help on APL language : System Functions & Variables : ŚCLASS Class hierarchy for object or class

[ Previous | Next | Contents | Index ]