Topic: APLX Help : Help on APL language : System Methods : ⎕MIXINS Return list of mixins
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

⎕MIXINS Return list of mixins


Implemented for Internal classes only.

Syntax:

    mixin_refs ← objref.⎕MIXINS
    mixin_refs ← ⎕MIXINS     (Within user-defined method, same as ⎕THIS.⎕MIXINS)

The system method ⎕MIXINS returns a vector of references to any mixins which have been added to an object using ⎕MIXIN, in the order in which they were added:

      a←⎕new class1
      a.⎕mixin class2
      a.⎕mixins
[class2]
      '.net' a.⎕mixin 'DateTime' 2004 5 6
      a.⎕mixins
[class2] [.net:DateTime]
      ⍴a.⎕mixins
2

If there are no mixins for the object, it returns an empty vector.

The references returned by ⎕MIXIN can typically be used to access methods or properties specific to the mixin. For example, if a method in the main class has the same name as a method in a mixin, the reference can be used to access the version in the mixin:

      a.⎕mixins[2].⎕classname
.net:System.DateTime
      a.⎕classname
class1

See the section on Mixins for more information.


Topic: APLX Help : Help on APL language : System Methods : ⎕MIXINS Return list of mixins
[ Previous | Next | Contents | Index | APL Home ]