Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5269 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61467 invoked by uid 1010); 5 Nov 2003 20:26:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61443 invoked from network); 5 Nov 2003 20:26:28 -0000 Received: from unknown (HELO molly.0x539.de) (217.28.101.185) by pb1.pair.com with SMTP; 5 Nov 2003 20:26:28 -0000 Received: from pd9e55c28.dip.t-dialin.net ([217.229.92.40] helo=leetspeak.org) by molly.0x539.de with asmtp (Exim 4.14) id 1AHUBN-0000jx-Ts for internals@lists.php.net; Wed, 05 Nov 2003 21:23:14 +0100 Message-ID: <3FA95CFC.5000504@leetspeak.org> Date: Wed, 05 Nov 2003 21:26:36 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20030924 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net References: <841D90E489448A4F804E1D1B95768BF7D4626D@lis-exchange3.lmu.ac.uk> <3FA930E7.4030405@tabini.ca> <3FA93D90.6090507@leetspeak.org> <3FA94176.3090301@tabini.ca> <3FA94B44.5080103@tabini.ca> In-Reply-To: <3FA94B44.5080103@tabini.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal: Array syntax From: cm@leetspeak.org (Michael Walter) Marco Tabini wrote: > George Schlossnagle wrote: > >> >> On Nov 5, 2003, at 1:29 PM, Marco Tabini wrote: >> >>> $a = [1,2,$b[11]] is semantically inconsistent. >> >> >> >> How so? Is >> > > I think I've already explained why. Not really understandable, though. > >> foo(array(1,2)); >> >> semantically inconsistent? On one hand () is used with a language >> construct (array()), whereas in the other context it indicates >> arguments to a function. I think that is what he meant by 'grouping' >> and 'application'. >> > > Actually, I think it meant something else. In any case, semantically you > can still think of array() as a function (until you throw in key > declarations, of course ;) ) Yup, I told you I meant something different (although on the same line of reasoning). I think you misunderstand "semantics", anyway. You should not think of array() as a function, as basically everything else except to the syntax is different to "real" functions, consider call_user_func('array', 1, 2, 3) or array_map('array', array(1, 2, 3), array("Foo", "Bar", "Baz")); How much better would look map('array', [1..3], ["Foo", "Bar", "Baz"]); anyway.. (although we really should not argue about that, as it's simply taste). >> Similar tokens have different syntactical meaning all over the >> language. Compare '<<' and '<<<'. To me that is no diffent that >> [] and []. > > > Again, that's not a good reason to introduce more. That is a statement backed up by good argumentation. :)