Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4918 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10088 invoked by uid 1010); 22 Oct 2003 21:32:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10047 invoked from network); 22 Oct 2003 21:32:09 -0000 Received: from unknown (HELO matrix.gna.ch) (195.226.6.8) by pb1.pair.com with SMTP; 22 Oct 2003 21:32:09 -0000 Received: from localhost (localhost [127.0.0.1]) by matrix.gna.ch (Postfix) with ESMTP id 5E1AA14C for ; Wed, 22 Oct 2003 23:32:08 +0200 (CEST) Received: by matrix.gna.ch (Postfix, from userid 65534) id 0B90A159; Wed, 22 Oct 2003 23:32:06 +0200 (CEST) Received: from cschneid.com (unknown [195.226.4.61]) by matrix.gna.ch (Postfix) with ESMTP id 24C3B14C for ; Wed, 22 Oct 2003 23:32:05 +0200 (CEST) Message-ID: <3F96F754.1090800@cschneid.com> Date: Wed, 22 Oct 2003 23:32:04 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031009 X-Accept-Language: de-ch, en-us, en MIME-Version: 1.0 To: internals@lists.php.net X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------070503010002050805040009" X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on matrix.gna.ch X-Spam-Level: X-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.60 X-Virus-Scanned: by AMaViS Ultramail snapshot-20020531 Subject: Proposal: Dangling comma in function call parameters From: cschneid@cschneid.com (Christian Schneider) --------------070503010002050805040009 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello everybody, just joined the internals list (after being absent from php developers lists for a while) so excuse my ignorance if any topic I bring up has been discussed already. I checked the archives but couldn't find anything... Proposal: Allow dangling commas in function call parameters. Reasoning: We use some handy vararg tool functions and it's nice to be able to write foo( 1, 2, 3, ); since it's then easy to add a new parameter without having to add a comma to the previous list. This would be symmetrical to the array() syntax. The patch for zend (php4 from cvs) would be minimal and I can't see any backwards-compatibility issues right now (patch attached). Any opinions? Regards, - Chris --------------070503010002050805040009 Content-Type: text/plain; name="dangling_comma.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dangling_comma.patch" Index: Zend/zend_language_parser.y =================================================================== RCS file: /repository/Zend/Attic/zend_language_parser.y,v retrieving revision 1.23 diff -u -r1.23 zend_language_parser.y --- Zend/zend_language_parser.y 4 Aug 2002 06:39:44 -0000 1.23 +++ Zend/zend_language_parser.y 22 Oct 2003 21:28:45 -0000 @@ -336,7 +336,7 @@ function_call_parameter_list: - non_empty_function_call_parameter_list { $$ = $1; } + non_empty_function_call_parameter_list possible_comma { $$ = $1; } | /* empty */ { $$.u.constant.value.lval = 0; } ; --------------070503010002050805040009--