Re: [PHP-DEV] Object and Array Literals

2011-06-18 Thread Paul Dragoonis
On Sun, Jun 19, 2011 at 3:56 AM, Daniel Convissor wrote: > Hi: > > I wasn't keen on earlier proposals for the [] array syntax.  Sean, your > case is laid out in a clear manner and addresses my concerns.  I like > this RFC. > > >>       * Strictness of unquoted keys. > > Keys should be quoted.  At

Re: [PHP-DEV] Object and Array Literals

2011-06-18 Thread Daniel Convissor
Hi: I wasn't keen on earlier proposals for the [] array syntax. Sean, your case is laid out in a clear manner and addresses my concerns. I like this RFC. > * Strictness of unquoted keys. Keys should be quoted. At the very least, unquoted keys should raise an E_NOTICE. > * Suppo

Re: [PHP-DEV] Object and Array Literals

2011-06-06 Thread Sean Coates
>>> $foo = { >>> 'bar' : function(){ >>> echo 'baz'; >>> } >>> }; >>> >>> $foo->bar(); >> >> I guess it's not yet too late to surpass Perl in the front of obscurity... > > Since the stuff to the right of the assignment operator (`:` in this case) is > valid PHP, I don't see why this wo

Re: [PHP-DEV] Object and Array Literals

2011-06-06 Thread Marcel Esser
On Mon, 2011-06-06 at 13:10 -0400, Sean Coates wrote: > > Please add the RFC header so we know what's the status. > > Thanks for catching this. > > >> $a = ['one': 1, 'two': 2, 'three': 'three']; > > > > has anyone played with the parser to > > implement it? > > I have not, personally. I feel l

Re: [PHP-DEV] Object and Array Literals

2011-06-06 Thread Sean Coates
> Please add the RFC header so we know what's the status. Thanks for catching this. >> $a = ['one': 1, 'two': 2, 'three': 'three']; > > has anyone played with the parser to > implement it? I have not, personally. I feel like it would be a waste of time at this point, unless a logical problem c

Re: [PHP-DEV] Object and Array Literals

2011-06-06 Thread Pierre Joye
hi Sean, Please add the RFC header so we know what's the status. Some comments: > $a = [1,2,'three']; I liked the existing RFC (https://wiki.php.net/rfc/shortsyntaxforarrays) so I indeed like it here too. > $a = ['one': 1, 'two': 2, 'three': 'three']; -1, did not like before, I still do not l

Re: [PHP-DEV] Object and Array Literals

2011-06-06 Thread Sean Coates
> Can you provide an use case and code example of how that would look? Sure. Here's how an ElasticSearch query currently looks in PHP: $esQuery = new \StdClass; $esQuery->query = new \StdClass; $esQuery->query->term = new \StdClass; $esQuery->query->term->name = 'beer'; $esQuery->size = 1; // O

Re: [PHP-DEV] Object and Array Literals

2011-06-06 Thread dukeofgaming
On Mon, Jun 6, 2011 at 8:48 AM, Sean Coates wrote: > > I was careful in the RFC to indicate that this is *not* JSON, but if others > feel as strongly as you do about the use of this term, I think it can be > removed without hurting the idea (as you indicated). > Still, it is mentioned so many tim

Re: [PHP-DEV] Object and Array Literals

2011-06-06 Thread Sean Coates
> a) JSON is actually being mentioned to advocate for the syntax with for the > sake of *familiarity*. > b) Interoperability is being confused with familiarity. My goal is interoperability. Familiarity is a factor, definitely. > c) Actual interoperability of the syntax with JSON is just a happy >

Re: [PHP-DEV] Object and Array Literals

2011-06-06 Thread Sean Coates
re "JSON" > · will never validate as JSON > > ·recognizablyviolates JSON quoting rules > · recognizably violates the JSON security concept… … > -- I do not feel that the acronym JSON has any clarifying nor edifying > place in the RFC describing this syntax. > I have ac

Re: [PHP-DEV] Object and Array Literals

2011-06-05 Thread dukeofgaming
On Sun, Jun 5, 2011 at 6:06 PM, Sanford Whiteman < sa...@cypressintegrated.com> wrote: > > -- I do not feel that the acronym JSON has any clarifying nor edifying > place in the RFC describing this syntax. > > Rather, I would suggest one of the following: > > · JavaScript-like [object|array] literal

Re: [PHP-DEV] Object and Array Literals

2011-06-05 Thread Sanford Whiteman
As ordered, I will stick to what I feel are community issues and try to be impersonal. If PHP users want to be clear that we have made an educated choice to use/maintain the language, we should appear impeccably well-versed in the technologies which complement and compete with PHP. I f

Re: [PHP-DEV] Object and Array Literals

2011-06-05 Thread Sean Coates
>> $foo = { >>'bar' : function(){ >> echo 'baz'; >>} >> }; >> >> $foo->bar(); > > I guess it's not yet too late to surpass Perl in the front of obscurity... Since the stuff to the right of the assignment operator (`:` in this case) is valid PHP, I don't see why this wouldn't be

RE: [PHP-DEV] Object and Array Literals

2011-06-05 Thread Zeev Suraski
> -Original Message- > From: dukeofgaming [mailto:dukeofgam...@gmail.com] > Sent: Monday, June 06, 2011 12:18 AM > To: Chris Stockton > Cc: Jordi Boggiano; Sean Coates; PHP internals > Subject: Re: [PHP-DEV] Object and Array Literals > > I like the idea of

Re: [PHP-DEV] Object and Array Literals

2011-06-05 Thread dukeofgaming
I like the idea of supporting both "=>" and ":". Would this work?: $foo = { 'bar' : function(){ echo 'baz'; } }; $foo->bar(); And I'm guessing this shouldn't work: $array = array('foo' : 'bar'); Regards, David On Sun, Jun 5, 2011 at 4:11 PM, Chris Stockton wrote: > He

Re: [PHP-DEV] Object and Array Literals

2011-06-05 Thread Chris Stockton
Hello, On Sun, Jun 5, 2011 at 2:03 PM, Jordi Boggiano wrote: > Thanks for working on this. > > On Sun, Jun 5, 2011 at 3:30 AM, Sean Coates wrote: >> 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 re

Re: [PHP-DEV] Object and Array Literals

2011-06-05 Thread Jordi Boggiano
Thanks for working on this. On Sun, Jun 5, 2011 at 3:30 AM, Sean Coates wrote: > 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. TBH, I dropped half-way t

[PHP-DEV] Object and Array Literals

2011-06-04 Thread Sean Coates
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 discussi