Re: [Pyobjc-dev] Re: [Pythonmac-SIG] pyobjc / cocoa
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2002-10-16 17:02:02
|
This is exactly what the Java bridge does and it is a huge source of confusion and bugs. Most developers assume that it should be (key, value), not (value, key) -- even developers that have spent years with the ObjC version of the Foundation. In teaching WebObjects classes, I spent a very good part of my "walk around the room and help students" time fixing problems that were related to this kind of mapping across the bridge (or, in the case of pure Java version of WO, the implicit mapping as a result of the pure Java rewrite). The Objective-C APIs were very carefully designed over many years (starting in 1986). The vocabulary used by those APIs leverage the syntax of the language (and of languages like it -- see SmallTalk). Attempting to map that vocabulary straight to Java or Python results in a new API whose vocabulary is incomplete and confusing. If there are situations where the existing mapping doesn't work-- that rare case where an '_' appears in the method name other than at the beginning (I grep'd through all of the headers provided by Apple and there isn't a single case where a '_' is used anywhere but to prefix the method)-- then providing a Python accessible function that is equivalent to objc_msgSend() will fix the problem (It will also fix a couple of other problems -- like how to support varargs). b.bum On Wednesday, October 16, 2002, at 12:26 PM, William Dozier wrote: > This is the best suggestion I have seen yet. > On Wednesday, Oct 16, 2002, at 09:49AM, Ronald Oussoren > <ous...@ci...> wrote: >> [obj setObject:value forKey:key] -> obj.setObjectForKey(value, key) |