[Pyobjc-dev] Re: [Pythonmac-SIG] pyobjc / cocoa
Bob Ippolito
bob@mastersofbranding.com
Wed, 16 Oct 2002 15:02:31 -0400
On Wednesday, Oct 16, 2002, at 14:54 America/New_York, Seth Delackner
wrote:
> 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);
Surely you _could_ do something like this, relatively easily at that,
but with this method you can't do any subclassing.
-bob