Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47816 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54560 invoked from network); 7 Apr 2010 06:27:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2010 06:27:49 -0000 Authentication-Results: pb1.pair.com header.from=martin@divbyzero.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=martin@divbyzero.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain divbyzero.net from 87.230.111.147 cause and error) X-PHP-List-Original-Sender: martin@divbyzero.net X-Host-Fingerprint: 87.230.111.147 mx.bauer-kirch.de Linux 2.6 Received: from [87.230.111.147] ([87.230.111.147:50331] helo=mx.bauer-kirch.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/F7-05593-4E52CBB4 for ; Wed, 07 Apr 2010 02:27:48 -0400 Received: by mx.bauer-kirch.de with ESMTP id 1NzOjk-0001z5-L3; Wed, 07 Apr 2010 08:27:40 +0200 Message-ID: <4BBC25DD.7060604@divbyzero.net> Date: Wed, 07 Apr 2010 08:27:41 +0200 MIME-Version: 1.0 To: Pierre Joye CC: Stanislav Malyshev , Hannes Magnusson , GM , internals@lists.php.net, Rasmus Lerdorf References: <745C5243-EB51-4D43-B036-8A34CDBBB547@gregory.net> <4BB68D61.2070301@lerdorf.com> <4BB6938F.7090404@zend.com> <4BB90DB7.6060706@zend.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Named Parameters From: martin@divbyzero.net (Martin Jansen) On 5.4.2010 00:45, Pierre Joye wrote: > On Mon, Apr 5, 2010 at 12:07 AM, Stanislav Malyshev 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. I would go as far as disallowing mixing of named and unnamed parameters completely. But that's probably just me. - Martin