RE: CIF-JSON new draft
- Subject: RE: CIF-JSON new draft
- From: "Bollinger, John C" <John.Bollinger@xxxxxxxxxx>
- Date: Thu, 4 May 2017 13:09:08 +0000
- Accept-Language: en-US
- authentication-results: iucr.org; dkim=none (message not signed)header.d=none;iucr.org; dmarc=none action=none header.from=STJUDE.ORG;
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SJCRH.onmicrosoft.com; s=selector1-stjude-org;h=From:Date:Subject:Message-ID:Content-Type:MIME-Version;bh=OBgvZX94hXJkPVgri3m6vNs5QxneVSuMT72q+i6tgRY=;b=GI0J51ru1yMhuaPT7Z0te9xdDI24QlG6R3MYrPYPcMhwd0CyVkRWZQA2pdeLlVcYAxTwpWD0F23Jsl23MRvOhgGksVRuTLyif0hKl+Bro/kkGQyH1AM4mv6pd/glbqRv59Er+trCvYT7xw+666IUtaHxPdz7Gaaa3bwqg/Mf2j8=
- In-Reply-To: <CAF_YUvXkWoPFpgHe7u4Pr+h7SLtpypmAU0aSBfFD294fQdUvZA@mail.gmail.com>
- References: <CAM+dB2ey9kKLoZY=WE7Uy-fiWTGhQaFx7fcgODcYfhrNPwXkQw@mail.gmail.com><MWHPR04MB05123A9F46812A3372A252FCE0160@MWHPR04MB0512.namprd04.prod.outlook.com><MWHPR04MB051249D1082721C51E84232FE0160@MWHPR04MB0512.namprd04.prod.outlook.com><CAF_YUvVjKTmCC18=pNGgANU25phE8Gij9=boT=nw8vUZQKPHmw@mail.gmail.com><CACaHzQVW=koD_QV+70veqQL0PFQxLkB_Xhgs61xGK6_FTr91Fw@mail.gmail.com><CAF_YUvXkWoPFpgHe7u4Pr+h7SLtpypmAU0aSBfFD294fQdUvZA@mail.gmail.com>
- spamdiagnosticmetadata: NSPM
- spamdiagnosticoutput: 1:99
The issue is primarily with JSON implementations other than JavaScript’s, though to a lesser extent, it is also with presenting a gotcha in JS context. For example,
I have been playing around with JSON-C (https://github.com/json-c/json-c/wiki), which seems to be one of the more popular C implementations. It uses C null pointers to represent JSON null values, and its functions for accessing array elements and object fields
return null when no such field or element exists. The case of a null-valued field or array element is thus difficult (but not impossible) to distinguish from the case where there is no such field or element at all. In the particular case of JSON-C, this appears to be a recognized shortcoming. The most recent version provides a new function for accessing object fields that
works around the problem, though it is not a drop-in replacement for the old. I anticipate that similar issues will be relatively common in other implementations, however, and it would be naïve to suppose that such implementations will not be used to handle
CIF-JSON. Now, this may be an issue that we simply choose to accept. I never said it was *impossible* to distinguish between absent and present-but-null in any implementation
I know about or contemplate, so it is not a fatal flaw. But I am considering how to make CIF-JSON as easy to program for as possible, by making design choices that minimize gotchas for users. John From: cif-developers [mailto:cif-developers-bounces@iucr.org]
On Behalf Of Robert Hanson That's true. I hadn't thought of that. Of course, that's what the === operator is for. John, what's the issue? On Wed, May 3, 2017 at 5:53 PM, Marcin Wojdyr <wojdyr@gmail.com> wrote:
Robert M. Hanson Email Disclaimer: www.stjude.org/emaildisclaimer Consultation Disclaimer: www.stjude.org/consultationdisclaimer |
_______________________________________________ cif-developers mailing list cif-developers@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- Follow-Ups:
- Re: CIF-JSON new draft (James Hester)
- References:
- CIF-JSON new draft (James Hester)
- RE: CIF-JSON new draft (Bollinger, John C)
- RE: CIF-JSON new draft (Bollinger, John C)
- Re: CIF-JSON new draft (Robert Hanson)
- Re: CIF-JSON new draft (Marcin Wojdyr)
- Re: CIF-JSON new draft (Robert Hanson)
- Prev by Date: Re: CIF-JSON new draft
- Next by Date: RE: CIF-JSON new draft
- Prev by thread: Re: CIF-JSON new draft
- Next by thread: Re: CIF-JSON new draft
- Index(es):