Product Site

6.15. The METHODS StringTable (.METHODS)

The .METHODS environment symbol identifies a StringTable of methods that ::ATTRIBUTE, ::CONSTANT, or ::METHOD directives in the currently running program define. The StringTable indexes are the method names. The StringTable values are the method objects.

Only methods or attributes that are not preceded by a ::CLASS directive are in the .METHODS StringTable. These are known as floating methods. If there are no such methods, the .METHODS symbol has the default value of .METHODS.
Example 6.3. .METHODS
/* .methods contains one entry with the index (method name) "TALK" */
o=.object~enhanced(.methods)  /* create object, enhance it with methods */
o~talk("echo this text")  /* test "TALK" method */
::method talk  /* floating method by the name of "TALK" */
  use arg text  /* retrieve the argument */
  say text  /* display received argument */