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

1820Re: [json] Re: Operator-overloaded JSON API: best way to handle arrays?

Expand Messages
  • John Cowan
    Feb 20, 2012
    • 0 Attachment
      wjosdejong scripsit:

      > I think implicitly creating arrays is quite tricky. For example,
      > if you look at
      > jsondoc["foo"][1]["bar"] = "harhar";
      > the type of the key (String or Number) determines if an object or an
      > array will be created...

      On the contrary, I think this is a very good idea. It's called
      "autovivification" in Perl, and is very convenient. It is particularly
      nice that the static type of the key determines what sort of JSON object
      to make.

      --
      John Cowan cowan@... http://ccil.org/~cowan
      This great college [Trinity], of this ancient university [Cambridge],
      has seen some strange sights. It has seen Wordsworth drunk and Porson
      sober. And here am I, a better poet than Porson, and a better scholar
      than Wordsworth, somewhere betwixt and between. --A.E. Housman
    • Show all 4 messages in this topic