Re: Object and Array Literals
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 like it would be a waste of time at this point, unless a logical
> problem can be identified.
>
> > Also the : syntax was not the preferred one either in
> > the short syntax RFC.
>
> This RFC is a superset of the short array syntax RFC, in my opinion.
>
> > About the anonymous objects, the usage of stdclass is rare, at least
> > for the ones I met or use.
>
> We use it a lot. This grep is from the root of the Gimme Bar code (my work project):
>
> $ grep -ir 'StdClass' * | wc -l
> 229
>
> > 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.
>
> You've just stated that you don't use this sort of thing very often (which is fine,
> but users who don't use this very often are not my intended target audience for this RFC).
>
> In my experience, users who DO interact with systems that speak JSON (or a JSON-like syntax)
> find this very useful, and have been wanting it for a long time. I have anecdotal evidence of this,
> but I could draw up something more concrete if that's what is required to get this to pass.
>
> S
>
>
While I would have been happy with the short array syntax proposed
earlier, I do have to say that Sean's points make a lot of sense to me
and I am strongly inclined to agree with him.
I can't really see any harm in this superset compared to the previous;
it seems to me like it would just make a lot of things handier.
- M.
--
Marcel Esser
VP/Engineering, CROSCON
Washington, D.C. Office
@: [email protected]
office.us +1 (202) 470-6090
mobile.us +1 (202) 250-1988
mobile.de +49 (0)176 391 226 23
Thread (18 messages)