Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34677 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52008 invoked by uid 1010); 11 Jan 2008 06:19:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51993 invoked from network); 11 Jan 2008 06:19:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2008 06:19:13 -0000 Authentication-Results: pb1.pair.com header.from=tomi@cumulo.fi; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=tomi@cumulo.fi; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cumulo.fi from 81.228.8.154 cause and error) X-PHP-List-Original-Sender: tomi@cumulo.fi X-Host-Fingerprint: 81.228.8.154 pne-smtpout4-sn2.hy.skanova.net Solaris 10 (beta) Received: from [81.228.8.154] ([81.228.8.154:47637] helo=pne-smtpout4-sn2.hy.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 98/7D-51656-06A07874 for ; Fri, 11 Jan 2008 01:19:13 -0500 Received: from [192.168.1.3] (84.250.46.16) by pne-smtpout4-sn2.hy.skanova.net (7.3.129) (authenticated as kaisto-9) id 471A7B0C0043F385 for internals@lists.php.net; Fri, 11 Jan 2008 07:17:53 +0100 Organization: Cumulo Studio To: internals@lists.php.net Date: Fri, 11 Jan 2008 08:15:26 +0200 User-Agent: KMail/1.9.7 References: <200801101612.30430.tomi@cumulo.fi> <200801101918.10525.larry@garfieldtech.com> In-Reply-To: <200801101918.10525.larry@garfieldtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200801110815.26615.tomi@cumulo.fi> Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut From: tomi@cumulo.fi (Tomi Kaistila) > The [] array literal syntax is also used by Javascript, and there's even an > object literal syntax, {}, which is quite nice. Does that mean "Javascript > is classic Perl"? Yes, the first thing that comes to mind from this syntax is Perl. (1, 2, 3, 4, 5) ("dharma", "wilma", "greg", "mina") qw{ wilhelm yaztsee ben madonna } qw! wilhelm yaztsee ben madonna ! qw[ wilhelm yaztsee ben madonna ] Does this look familiar? Javascript is not classic Perl but the proposed way of assign array values is. > The [a:b, c:d] syntax would be more JSON-esque, while [a => b] syntax would > be more consistent with existing PHP. The latter, I think, would get > better traction with existing developers and be easier to understand (since > it uses the same separator character). If this is implemented, I would agree that sticking as close to the old syntax as possible is the best approach. I would go with the choice B except instead of square brackets use round brackets. $a = (1, 2, 3, 4, 5); $a = (1 => 'dharma', 2 => 'wilma'); This would be consistent with the old way of assigning array values and will probably least confuse both new and old developers. Tomi Kaistila PHP Developer