Fwd: [Pythonmac-SIG] Towards PyObjC 3.0

Nicholas Cole <[email protected]> Wed, 4 Jun 2014 07:59:20 +0100
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <CAAu18hdie5sQDTjtwr_BypC89vLQ_YRBkzy6hyjUjRt8MPBP0Q@mail.gmail.com>
On Wed, Jun 4, 2014 at 12:46 AM, Greg Ewing <[email protected]> wrote:
>    counter.incrementBy(2, numberOfTimes: 7)
>
> It doesn't explicitly say at that point, but I strongly suspect that
> you *have* to call it *exactly* like that, and not any of these ways:
>
>    counter.incrementBy(2, 7)
>    counter.incrementBy(amount: 2, numberOfTimes: 7)
>    counter.incrementBy(numberOfTimes: 7, amount: 2)
>
> In other words, it's just syntactic sugar for an Objective-C method
> call, and not a true keyword-argument system. Which is rather disappointing,
> and doesn't help at all with interfacing to Python.

The manual says that this is optional, and that you can define the
first argument as a keyword one.  You can also define default values,
so perhaps it is not quite as restrictive as you fear.

The first-arguemt-is-by-default-not-a-keyword is the kind of thing
that makes sense now, as developers move from Obj-C, but surely is
going to feel very odd if swift ever catches on.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech