On Wed, Apr 7, 2010 at 8:27 AM, Martin Jansen <mar...@divbyzero.net> wrote:
> On 5.4.2010 00:45, Pierre Joye wrote:
>> On Mon, Apr 5, 2010 at 12:07 AM, Stanislav Malyshev <s...@zend.com> wrote:
>>
>>> 3. Combining named and un-named params can get weird - i.e. foo(1,2,3) is
>>> simple, foo(1, 2, bar => 3) is doable, but foo(1, 2, bar => 3, 4) would be
>>> trouble, since it is not clear at all where 4 should go to. Moreover,
>>
>> If we introduce named argument, mixing them should not be weird. An
>> argument can have both a name and a position, allowing combination of
>> normal or named arguments. Python's way to do it is very nice and
>> handy:
>>
>> http://diveintopython.org/power_of_introspection/optional_arguments.html
>
> Just to be clear about this:  Python does not allow using an unnamed
> parameter after a named parameter occurred, i.e. foo(bar = 3, 2) is not
> valid there.

Right, the doc is clear about that and makes the whole thing less confusing.

> I would go as far as disallowing mixing of named and unnamed parameters
> completely.  But that's probably just me.

That would defeat the main purposes of named arguments.

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to