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

1047Re: JSON syntax grammar is missing 'undefined' literal value

Expand Messages
  • Shelby Moore
    May 25, 2008
    • 0 Attachment
      Douglas Crockford wrote:
      > JSON was intended to be language independent. Most languages have or
      > tolerate
      > the idea of a null value. Very few languages have two of them.

      Wow, thanks for the quick reply. Other than the legacy issue I
      pointed out in my prior message, could I perhaps change your mind?

      Afaics, neither C or C++ have a null datatype (C also no bool).
      Either must tag all values with an enum(eration) of value types, or
      use (void*)0 for null. Enum tagging could handle another datatype, or
      use (void**)0. Classes in C++ don't help, because there is no typeof.
      Or perhaps could use operator overloading in C++ with a class to
      detect instances of that class.

      It seems most all languages either fall into the above scenario of
      simulating null (and thus could simulate undefined), or the modern
      non-prototype 00 languges have a means for detecting the class of an
      object, so then use new Undefined(). Afaik, even Java's Null type is
      just a class.

      I am working on an implicit schema for JSON (to enable Web 3.0
      decentralized mashups) and I am thinking of declaring undefined to be
      a legal value and usurp your defacto standard. Could you please steer
      me otherwise with further logic?

      Again thanks a lot for the feedback.
    • Show all 19 messages in this topic