Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53047 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17074 invoked from network); 6 Jun 2011 16:44:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 16:44:08 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:55607] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/24-23189-7D30DED4 for ; Mon, 06 Jun 2011 12:44:08 -0400 Received: by wyb34 with SMTP id 34so3340059wyb.29 for ; Mon, 06 Jun 2011 09:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HDEu+56DbJE89+SJXSxKBSaGKLUOxHwrJxL3hab41O0=; b=t5i+NUfv+E/YwKLkWog9tdJEbuzeGuoqNHCv8cIvHnisNQMn26JtiwtH09YuBI2LwQ VWyDVSFfI3rjCrWSwWOXT/MP7In4jbiKYzpvg7kOEDEwjBzNdmZR9UaXRDu1WL2/SKhZ uFOeReMlEs85dSOsIL83wXgFBzi5DSnPy30ZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=nbXYpV4stvSD6CaGkXDhqK4QWn45cY5wJQwlgq1mW0CgNLvM2v33D4xm/tHRkj/jRL k+29oekCwVBz0Rf/MmvnW6DGEd53VRoC84NMqHFeY8kBzH0TFT9p5xeujbHuUsiDuU7A EmRF2AcbKKhnxwB81+2if1zdUHAkE2O6vJMhM= MIME-Version: 1.0 Received: by 10.216.79.11 with SMTP id h11mr4870917wee.77.1307378644495; Mon, 06 Jun 2011 09:44:04 -0700 (PDT) Received: by 10.216.253.168 with HTTP; Mon, 6 Jun 2011 09:44:04 -0700 (PDT) In-Reply-To: <084D2F1E-87E7-44CF-B8B6-47A250AD928D@seancoates.com> References: <084D2F1E-87E7-44CF-B8B6-47A250AD928D@seancoates.com> Date: Mon, 6 Jun 2011 18:44:04 +0200 Message-ID: To: Sean Coates Cc: PHP internals Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Object and Array Literals From: pierre.php@gmail.com (Pierre Joye) hi Sean, Please add the RFC header so we know what's the status. Some comments: > $a =3D [1,2,'three']; I liked the existing RFC (https://wiki.php.net/rfc/shortsyntaxforarrays) so I indeed like it here too. > $a =3D ['one': 1, 'two': 2, 'three': 'three']; -1, did not like before, I still do not like it :) It will certainly create some confusions and does not bring a lot of benefits. I'm not sure how it will work either with a possible support of named arguments. Last but not least, has anyone played with the parser to implement it? Also the : syntax was not the preferred one either in the short syntax RFC. About the anonymous objects, the usage of stdclass is rare, at least for the ones I met or use. I'm not sure about the interoperability argument as conversions will still happen, so as someone else said, it looks familiar but has in my opinion nothing to do with interoperability. I'd to say a temporary -1. Something that can change my mind is the ability to initialize an object and its property using a similar syntax, but it sounds tricky or not too useful (getter/setter a la c# sounds much useful for example, if we need something in this area). A last comment for the record here, this whole JSON-like syntax sounds wrong to me from the beginning. JSON does not aim to be written or read by human being. It is about exchanging data between two ends. I don't think using it as a base for a syntax in a language is a good thing to do. On Sun, Jun 5, 2011 at 3:30 AM, Sean Coates wrote: > Hello. > > I've posted a RFC concerning Object and Array Literals on the wiki: https= ://wiki.php.net/rfc/objectarrayliterals > > Please read, and if you have a comment that is not already covered in the= RFC, raise it here. I'm definitely open to discussion, but I would really = love to keep this discussion civil. > > To get the ball rolling, here are a few points that I think we need to di= scuss: > > =A0 =A0 =A0 =A0=95 Strictness of unquoted keys. > =A0 =A0 =A0 =A0=95 Support =3D> in addition to : as a key:value separator= . > =A0 =A0 =A0 =A0=95 possibility of simply not supporting the \u### syntax = for Unicode characters in literal strings (just like the rest of PHP). > =A0 =A0 =A0 =A0=95 Should mixed-format (numeric and associative arrays) b= e allowed? (e.g. [1,'two':2, 3]) > > I beg you to keep name-calling, conclusion-jumping, and general hostility= out of this thread. Thanks for your attention. > > S > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org