Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10095 invoked from network); 12 Jan 2014 18:58:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2014 18:58:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.241 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.241 imap3-1.ox.registrar-servers.com Received: from [198.187.29.241] ([198.187.29.241:60615] helo=imap3-1.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/80-05483-5D5E2D25 for ; Sun, 12 Jan 2014 13:58:31 -0500 Received: from localhost (localhost [127.0.0.1]) by oxmail.registrar-servers.com (Postfix) with ESMTP id 08E242A006A; Sun, 12 Jan 2014 13:58:27 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap3.ox.registrar-servers.com Received: from oxmail.registrar-servers.com ([127.0.0.1]) by localhost (imap3.ox.registrar-servers.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GpVNV6VzgiIg; Sun, 12 Jan 2014 13:58:26 -0500 (EST) Received: from [192.168.0.200] (unknown [176.25.177.94]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 3DD302A0053; Sun, 12 Jan 2014 13:58:26 -0500 (EST) Message-ID: <52D2E5D0.5070109@ajf.me> Date: Sun, 12 Jan 2014 18:58:24 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Christian Stadler , internals@lists.php.net References: <581A185E-0F00-4B49-AA87-859D75E63BA2@googlemail.com> <52D2CAAF.9040708@ajf.me> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Revisiting the "Named Arguments" RFC From: ajf@ajf.me (Andrea Faulds) On 12/01/14 17:27, Christian Stadler wrote: > Am 12.01.2014 18:07, schrieb Kevin Ingwersen: >> Am So. Jan. 12 2014 18:02:39 schrieb Andrea Faulds: >>> On 12/01/14 09:14, Kevin Ingwersen wrote: >>>> So therefore, I would actually suggest using colons. It does quite mimic the ObjC calling style, but it keeps the old-fashioned function style, which I honestly prefer (besides, adopting an ObjC messaging style syntax would be either ultra-hard or never accepted :D). >>> It also looks like C#'s named arguments. >> Oh really? Good to know, I never did anything more than Hello World with C#, because I dont trust in Mono a lot on OS X ^^; > > Personally as a layman I'd prefer that syntax, too. And for keywords: > You could simply put them in quotes, making is similar to the > object-syntax in JavaScript/ECMAScript. And even variable-handling would > be out of the discussion I guess: > > $abc = 'class'; > test(foo: "oof", bar: "rab", 'function': 'moo', $abc: 'Foobar'); > What if we combined two? test(foo: "x", 'thing' => "y"); Where the : syntax is prefixed by a bare word which is the parameter name, while the => syntax is prefixed by an expression which evaluates to a string, which is the parameter name. Though that might be confusing. It would be semi-consistent with existing array syntax, and we could then also add foo: to arrays. -- Andrea Faulds http://ajf.me/