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

Jack Jansen Jack.Jansen@cwi.nl
Wed, 16 Oct 2002 17:25:10 +0200


On Wednesday, October 16, 2002, at 04:49 , Ronald Oussoren wrote:

> To reply to myself...
>
> Another mapping scheme would be to just drop the colons and translate 
> the character just beyond colons to uppercase. This would make the 
> python methodnames more pleasant, although still long and 'foreign 
> looking':
>
> 	[obj setObject:value forKey:key] -> obj.setObjectForKey(value, key)

I think the bottom line is: which method makes it easiest to write 
Python code given Apple's documentation? I must say I haven't looked at 
the Java Cocoa documentation (actually, I tend to read the ObjC header 
files mostly) but if that is good then I think we should stick with the 
Java names. If it isn't good (or nonexistent:-) then an algorithmic name 
translation scheme is probably best.

Something else that might be worthwhile is a helper command that 
translates ObjC calls to Python. You would then copy [obj setObject: 
value forKey: key], paste it in your Python script (where it will stay 
selected) and select the "ObjC methodcall to Python" command to turn it 
into obj.setObjectForKey(value, key). The only question is how we could 
get this into Project Builder (into the Python IDE would be easy).
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -