Product Site

5.1.1.10. enhanced

Returns an enhanced new instance of the receiver class, with object methods that are the instance methods of the class, enhanced by the methods in the collection methods. The collection indexes are the names of the enhancing methods, and the items are the method objects (or strings or arrays of strings containing method code). You can use any collection that supports a supplier method.

enhanced sends an init message to the created object, passing the arguments specified on the enhanced method.

See also method define.
Example 5.5. Class class — enhanced method
/* Set up rclass with class method or methods you want in your */
/* remote class */
rclassmeths = .directory~new

rclassmeths["DISPATCH"]=d_source     /* d_source must have code for a  */
                                     /* DISPATCH  method.              */
/* The following sends init("Remote Class") to a new instance */
rclass=.class~enhanced(rclassmeths,"Remote Class")