Re: Terminology: Are There Messages in Java?
Stefan Ram wrote:
Mark Space <markspace@sbc.global.net> writes:
Does "method" not work? It confuses the call with the declaration, I
guess, but sometimes words get overloaded too, just like method names.
I hesitate to call ?f( 2 )? a ?method? for at least two
reasons:
In the call ?( a() ? b : c ).f( 2 )?, ?b? and ?c? might have
different classes, with different methods matching ?f( 2 )?.
Except the method can't be on different classes. The static type of both
b and c must have a shared base class that defines f(int );
So, the ?f? in ?f( 2 )? does not actually refer to a specific
method yet (before evaluation of the complete expression).
It is a simple method /name/ (?selector?), not a method.
Its not actually a method name selector, but a virtual method invocation.
?f( 2 )? contains more information than just the name ?f?,
it also contains the argument value ?2?, which might be deemed
to be just as ?important? as the ?f?.
The invocation contains the information of what is being invoked, and
what is being passed to it. Thats why the Method.invoke method is
declared to take arguments.
java.lang.reflect.Method.invoke(Object targetObject, Object...arguments)
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>