[Pyobjc-dev] Re: [Pythonmac-SIG] pyobjc / cocoa

Seth Delackner seth@jtan.com
Wed, 16 Oct 2002 11:54:37 -0700


On Wednesday, October 16, 2002, at 06:18 , Bob Savage wrote:
> I just want to point out one more thing: because these are part of the 
> name of the method, and not truly labels, the following two methods are 
> distinct:
>
> [obj message: arg1 withFoo: arg2];
> [obj withFoo:arg2 message:arg1];
>
> Those are two different methods. This means that the Seth's system 
> would not work at all (although I don't like it because it makes the 
> relation between the 'labels' and arguments less clear).

I may be wrong, but I disagree with your assessment.  There is only a 
single mapping possible from my example (although now looking at it, my 
example had a typo).  What I meant is:

rt.call(obj, "message", arg1, "arg2name", arg2);
# giving us the message name = "message:arg1name:arg2name"

The method 'rt.call' would take arguments  [0] object to receive the 
message, [1] first part of the message name, [2] .  Each subsequent pair 
of arguments is interpreted as first the next chunk of the message name 
and then the next part of the message arguments.

Where is the ambiguity?  Also, since obj is really a python wrapper 
class for Objective-C objects, one could probably make 'call' a method 
(renamed to avoid conflicts) on the wrapper class, resulting in 
something like:

obj._call("message", arg1, "arg2name", arg2);