Loading ...
Sorry, an error occurred while loading the content.

Re: JSON Propositions

Expand Messages
  • Ben Atkin
    Here s what I mean: according to the JSON spec and in Ruby 1.8, if you parse { j :true, s :true, o :true, n } and throw out the input but keep the result,
    Message 1 of 51 , Jul 10, 2012
    View Source
    • 0 Attachment
      Here's what I mean: according to the JSON spec and in Ruby 1.8, if you parse {"j":true,"s":true,"o":true,"n"} and throw out the input but keep the result, there's no way to get the keys in their original order, ["j","s","o","n"]. In modern JS implementations, PHP, and Ruby 1.9, you can iterate over them in their original order. Both this:

      for (letter in obj) { console.log(letter); } and:

      Object.keys(obj)

      will have them in order.

      --- In json@yahoogroups.com, Andrew Faulds <ajfweb@...> wrote:
      >
      > Oh, that isn't special interpretation, that's just using keys your app
      > doesn't check.
      >
      > On 10 July 2012 21:15, Ben Atkin <ben@...> wrote:
      >
      > > **
      > >
      > >
      > > Outside of special interpretation of strings, there's only one change I
      > > can think of that JSON could make that many existing parsers would be
      > > forward compatible with, and that is ordering of pairs within a JSON
      > > object. The format is so simple, that it doesn't lend itself to clever
      > > hacks. I really like this aspect of JSON.
      > >
      > > Ben
      > >
      > >
      > > --- In json@yahoogroups.com, Tatu Saloranta <tsaloranta@> wrote:
      > > >
      > > > On Tue, Jul 10, 2012 at 12:55 PM, Borislav Iordanov
      > > > <borislav.iordanov@> wrote:
      > >
      > > > > On Tue, Jul 10, 2012 at 3:35 PM, Andrew Faulds <ajfweb@> wrote:
      > > > >> I don't think this is a good idea. One of the best things, if not the
      > > best,
      > > > >> about JSON is the lack of a version number. The standard is frozen
      > > and will
      > > > >> never change, and because of that there is only one thing called
      > > JSON, and
      > > > >> everything that supports "JSON" today will support it tommorow, too.
      > > > >
      > > > > That's a valid argument, but is it such a big deal given that anything
      > > > > in software evolves and it's just natural to deal with versions?
      > > >
      > > > For some perspective on this, one could consider fate of XML 1.1,
      > > > which actually does not have this issue -- versioning was fully
      > > > defined to allow such upgrade.
      > > > XML 1.1 has some other compatibility issues, but most importantly it
      > > > has not really been used extensively, and seems like a failure.
      > > >
      > > > So another way to ask this is: would anyone bother using a modified
      > > > version of (textual) JSON externally?
      > > >
      > > > -+ Tatu +-
      > > >
      > >
      > >
      > >
      >
      >
      >
      > --
      > Andrew Faulds (AJF)
      > http://ajf.me/
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • Jonas Tärnström
      The beauty and usefulness of JSON is in my opinion more of what they left out than what they took in. Any attempts to extend it is to make it less useful. //JT
      Message 51 of 51 , Aug 16, 2012
      View Source
      • 0 Attachment
        The beauty and usefulness of JSON is in my opinion more of what they left
        out than what they took in.
        Any attempts to extend it is to make it less useful.

        //JT

        2012/7/10 johnnys <marler8997@...>

        > **
        >
        >
        > I've published a web page with some propositions to modify JSON at
        > http://json.marler.info <http://json.marler.info>
        > I wanted to post this so I could see what people think of these
        > propositions. Any comments/suggestions/criticism are welcome.
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >



        --
        --
        Jonas T�rnstr�m
        Product Manager
        � e-mail: jonas.tarnstrom@...
        � skype: full name "Jonas T�rnstr�m"
        � phone: +46 (0)734 231 552

        ESN Social Software AB
        www.esn.me


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.