define >>-define(methodname-+---------+-)----------------------------->< +-,method-+ Incorporates the method object [method] in the receiver class's collection of instance methods. The method name [methodname] is translated to to uppercase. Using the [define] method replaces any existing definition for [methodname] in the receiver class. If you omit [method] , the method name [methodname] is made unavailable for the receiver class. Sending a message of that name to an instance of the class causes the [unknown] method (if any) to be run. The [method] argument can be a string containing a method source line instead of a method object. Alternatively, you can pass an array of strings containing individual method lines. Either way, [define] creates an equivalent method object. [Notes:]
Class class - define method bank_account=.object~subclass("Account") bank_account~define("TYPE",'return "a bank account"') |