Re: [Pyobjc-dev] NGPython
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2004-03-01 06:30:13
|
On Feb 29, 2004, at 12:13 PM, Helge Hess wrote: > With the mapping mechanism taking keywords and positional parameters > into account. > I think that this was much more beautiful than the current automatic > ":" => "_" scheme used in PyObjC ;-) It fails this simple test: can the mapping rule be expressed as a single rule. The ":" -> "_" mapping, though ugly (really -- none of us are attached to it), can: "Given an ObjC method name, replace all ":" with "_" to find the python name." A 'bridget' style mapping cannot. There will be special cases and the end result will be a new language that is effectively a hybrid between Python and Objective-C. Just like the Java<->Objective-C bridge, such an approach to "mapping" Objective-C methods into Python in a "Pythonic" fashion will yield something that requires the developer to learn a new language. To use the provided examples: > set = NSSet(array=myarray) > set = NSSet(set=otherSet) Neither of these are meaningful to either the Python or Objective-C developer. The current form is as follows: set = NSSet.setWithArray_(myarray) set = NSSet.setWithSet_(otherSet) While the trailing '_' are unpalatable to the traditional Python programmer, it is extremely clear exactly what the code is doing. If not, the developer only has to remember one rule to figure out what bit of Foundation documentation to read to figure it out. Relevant post here: http://www.pycs.net/bbum/2003/11/29.html Thread starts here: http://mail.python.org/pipermail/pythonmac-sig/2002-October/006458.html b.bum |