[Pythonmac-SIG] Naming schema for wrapped Apple frameworks

Jack Jansen Jack.Jansen at cwi.nl
Tue Dec 9 11:28:37 EST 2003


I'd like to take this "up one level" first, and decide on what problem 
we are trying to solve before coming up with solutions.

Let's assume the user has found a C example involving the Drag Manager. 
And let's assume (for no particular reason:-) that there are two 
symbols in the C example code that she wants to use in her Python code: 
the NewDrag() method and the kDragHasLeftSenderWindow constant.

Right now, the one is Carbon.Drag.NewDrag and the other 
Carbon.Drag.Dragconst. kDragHasLeftSenderWindow.

Not ideal, but useable for someone who (a) has Inside Mac and (b) knows 
the MacPython shortname/longname convention.

With the current Apple documentation (in as far as it is finished:-) 
things are worse, though, because all references to "Drag.h" have gone, 
there's only <Carbon/Carbon.h>.

So I think our goal could be stated as:
Someone who knows there are things called "NewDrag" and 
"kDragHasLeftSenderWindow" in "Carbon" should be able to use those in 
Python without any additional knowledge.

Does everyone agree, or is this goal too farfetched? Or, alternatively, 
is it too vague?

If we agree this is the goal then note that (due to very careful typing 
on my part:-) we could solve part of the problem in the IDE. Something 
along the lines of the user typing "Carbon..NewDrag" and hitting F1 and 
the IDE turning it into "Carbon.Drag.NewDrag". Which means we could 
keep a reasonably deeply nested namespace (albeit probably with a 
different naming scheme than the one in use today).
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman




More information about the Pythonmac-SIG mailing list