|
method >>-method(methodname)------------------------------------------>< Returns the method object for the receiver class's definition for the method name [methodname] . If the receiver class defined [methodname] as unavailable, this method returns the Nil object. If the receiver class did not define [methodname] , an error is raised. Class class - method method
/* Create and retrieve the method definition of a class */
myclass=.object~subClass("My class") /* Create a class */
mymethod=.method~new(" ","Say arg(1)") /* Create a method object */
myclass~define("ECHO",mymethod) /* Define it in the class */
method_source = myclass~method("ECHO")~source /* Extract it */
say method_source /* Says "an Array" */
say method_source[1] /* Shows the method source code */
|