Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5259 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58416 invoked by uid 1010); 5 Nov 2003 18:29:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58370 invoked from network); 5 Nov 2003 18:29:01 -0000 Received: from unknown (HELO tabini.ca) (198.63.211.18) by pb1.pair.com with SMTP; 5 Nov 2003 18:29:01 -0000 Received: from cpe0080c80c4893-cm013439900542.cpe.net.cable.rogers.com ([24.156.158.54] helo=tabini.ca) by tabini.ca with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AHSRY-0004BK-QE; Wed, 05 Nov 2003 12:31:49 -0600 Message-ID: <3FA94176.3090301@tabini.ca> Date: Wed, 05 Nov 2003 13:29:10 -0500 Organization: Marco Tabini & Associates, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031023 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Walter CC: internals@lists.php.net References: <841D90E489448A4F804E1D1B95768BF7D4626D@lis-exchange3.lmu.ac.uk> <3FA930E7.4030405@tabini.ca> <3FA93D90.6090507@leetspeak.org> In-Reply-To: <3FA93D90.6090507@leetspeak.org> X-Enigmail-Version: 0.81.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal: Array syntax From: marcot@tabini.ca (Marco Tabini) Michael Walter wrote: >>>> $a = [1,2,$b[11]]; >>>> >>>> Is that confusing enough for you? ;-) >>> >>> >>> >>> >>> What's confusing about it? >>> >> >> The fact that $b[11] references an item of an array, while >> [1,2,$b[11]] assigns values to the array $a. The fact that you (and, >> probably, most of us) can't tell right off the bat is a clear sign >> that this is a bad idea, because it's ambiguous and confusing. >> >> The same line using the current syntax, btw, would have looked like this: >> >> $a = array (1,3,$b[11]); > > Actually, $a = [1,2,$b[11]] would be amazingly clear and expressive in > comparison with the rather verbose array() version (same thing with the > swap, btw). I guess we'll have to agree to disagree :) $a = [1,2,$b[11]] is semantically inconsistent. >> As you can see the ambiguity is gone--square brackets are used for one >> purpose and nothing else. > > Actually, do you realize that you use () both for "grouping" and for > application? I can't see anything wrong with using square brackets for > array element access and array creation, to be honest. Actually, no, I don't. I'm not sure what "grouping" and "application" mean... Mt.