When composing a message, you can change the default search order for methods by doing both of the following:
The class symbol is usually the special variable SUPER, but it can be any environment symbol or variable name whose value is a valid class.
In A Sample Program Using Directives, an Account subclass of the Object superclass is created. It defines a TYPE method for Account, and creates the Savings subclass of Account. The example defines a TYPE method for the Savings subclass, as follows:
::class Savings subclass Account ::method 'TYPE' return "a savings account"
To change the search order so REXX searches for TYPE in the Account rather than Savings subclass, enter this instead:
::method 'TYPE' return self~type:super '(savings)'
When you create an asav instance of the Savings subclass and send a TYPE message to asav:
say asav~type
REXX displays:
an account
rather than:
a savings account
because REXX searches for TYPE in the Account class first.