Method name or signature not known at compile time
If the programmer does not know a method's name at compile time (for example,
it might be specified by user input), then the method can be invoked in
one of two ways, depending upon whether its signature is known:
- Suppose the signature of the method is known at compile
time (even though the method name is not). In that case, when the name of
the method becomes available at run time, the somLookupMethod, somFindMethod
or somFindMethodOk methods or the somResolveByName procedure
can be used to obtain a pointer to the method's procedure using name-lookup
method resolution, as described in the preceding topics. That method procedure
can then be invoked, passing the method's intended receiver, the Environment
pointer (if needed), the context argument (if needed), and the
remainder of the method's arguments.
- If the method's signature is unknown until run time,
then dispatch-function resolution is indicated, as described in the next
topic.
[Back: Name-lookup method resolution]
[Next: Dispatch-function method resolution]