method
Lookup by name a method of a class or an object.
(m)=method(a, name)
Inputs
a An object or class.
name The name of the method to lookup.
Outputs
m The method with the given name.


Description
If the method with the given name dos not exist, the function return null . If the input is a Java class which has multiple (polymorphic) methods of the same name, an array of these methods is returned.

If the method returned by this function is a static method in the class, it can be invoked just like any function by specifying the input arguments. Otherwise, it can be invoked for an object of its class by using the object as the first argument followed by the list of arguments to the method.
Example
>>class A
      >var x
      >function A(x)
      >   this.x=x
      >end
      >function add(y)
      >  return x+y
      >end
      >function neg()
      >   return -x
      >end
      >end
>>method(A.class,"add")
Method A.add
>>a=new A(10);
>>// Same as a.add(2)
>>method(A.class,"add")(a,2)
  12
>>a=new Vector()
>>method(Vector.class,"add")
[Ljava.lang.reflect.Method;@193a66f
  public void java.util.Vector.add(int,java.lang.Object)
  public synchronized boolean java.util.Vector.add(java.lang.Object)

>>method(Vector.class,"add")[2](a,10)
         1
>>method(Vector.class,"add")(2)(a,[2 3 4])
         1
>>a
[10, [[D@93d6bc]
>>a[1]
        10
>>a[2]
          2          3          4