[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
Re: CIF-JSON draft 2017-05-08
- Subject: Re: CIF-JSON draft 2017-05-08
- From: Marcin Wojdyr <wojdyr@xxxxxxxxx>
- Date: Thu, 11 May 2017 08:16:35 +0100
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;h=mime-version:in-reply-to:references:from:date:message-id:subject:to;bh=rqNf5EDPZC+Urjv/2Y9LENZ7rIFKHY0cG/6EJ3+JBLQ=;b=l89BAv+soJb5k7hTEzD8E+gpJ+Y1SWl/S9Az+qQlG67Vvp/CDRjWEd4BS1fj8WR3cDMC8kpIFHmpIbVScKQMTiFrAI9JhL4pzoYYNzefQb2kH+Y3H2t6BIj70UuW2CbFJ+Pv13BTNDy7L9+xB/5z/iYTmjF0o2XjduOIFKDqE2TJcKFMz9/gikmnDqqvI8HdlIqhvxMSALFFkOQTDxCmmd3HRfLZrNAml+Yk4UyncNfHJZhq5J2X5gd+vw8Jm8mNzAjXc6tRNyuGtHyBfhbxy76gxSJ6jISvif0C3aXy5en1oCCjLdODXT2VZnAybptH8rxDvYWR0FLduUPdzI0bMA==
- In-Reply-To: <CAM+dB2fyQe2KSNRv-+q=Sq3NFWSCK72kBTsUiiJfeSa=PQfvNQ@mail.gmail.com>
- References: <CAM+dB2cwoCG6LhPUePRup_hQtM9mXqwL4tULTPf-WGwJGtKrOA@mail.gmail.com><MWHPR04MB051220BFF5C7093CD86702CCE0EE0@MWHPR04MB0512.namprd04.prod.outlook.com><CAF_YUvW=i0XjfzmgA=m03a=X4Y03+FfH8_TAZ2dNPVAhCmuy5w@mail.gmail.com><MWHPR04MB0512E4FA07327A5E9103106CE0EE0@MWHPR04MB0512.namprd04.prod.outlook.com><CACaHzQVez_WUma3z2mAXYroiJtEDtxaUAS-n0Noz-R=nPBTF+w@mail.gmail.com><MWHPR04MB05120B2E2061754ABEBED31AE0EE0@MWHPR04MB0512.namprd04.prod.outlook.com><CACaHzQXKMAqo97iZ6ZdHP_yFhRVKiEBsyMbHZxkBxKwPPcc7LA@mail.gmail.com><MWHPR04MB0512A0D165506326550ED871E0EF0@MWHPR04MB0512.namprd04.prod.outlook.com><CAM+dB2fyQe2KSNRv-+q=Sq3NFWSCK72kBTsUiiJfeSa=PQfvNQ@mail.gmail.com>
> As far as numbers go, it is clear that representation of numbers as strings> should be allowed in order to support translation from CIF files. Translation from CIF is *easier* when the numbers are written asstrings, because one doesn't even need to parse numbers. But,comparing with complexity of parsing the CIF format, parsing numbs andwriting them as possibly two separate numbers is not that difficult.The downside of the quoted representation in JSON is of course thatthe recipient of such JSON file, after presumably using a third-partyJSON parser, needs to finish the parsing himself. John reasonably argued that a single representation is better thantwo. After thinking about it I'd agree. But I'd not agree with thechoice. Parsing numbers on the reading side should be done entirely bya JSON parser. Usually there are more consumers of file formats thanproducers, and the extra complexity is preferable in the CIF->JSONstep rather than when working with JSON. If anyone thinks that parsing numbs is trivial and no extra complexityis involved, I propose that someone familiar with C or C++ writes herea (thread-safe) function that can parse the numb format. As a hint:functions to parse numbers in a locale-independent way are availableonly in C++17 which is not widely adopted yet. Marcin_______________________________________________cif-developers mailing listcif-developers@iucr.orghttp://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- Follow-Ups:
- Re: CIF-JSON draft 2017-05-08 (James Hester)
- References:
- CIF-JSON draft 2017-05-08 (James Hester)
- RE: CIF-JSON draft 2017-05-08 (Bollinger, John C)
- Re: CIF-JSON draft 2017-05-08 (Robert Hanson)
- RE: CIF-JSON draft 2017-05-08 (Bollinger, John C)
- Re: CIF-JSON draft 2017-05-08 (Marcin Wojdyr)
- RE: CIF-JSON draft 2017-05-08 (Bollinger, John C)
- Re: CIF-JSON draft 2017-05-08 (Marcin Wojdyr)
- RE: CIF-JSON draft 2017-05-08 (Bollinger, John C)
- Re: CIF-JSON draft 2017-05-08 (James Hester)
- Prev by Date: Re: CIF-JSON draft 2017-05-08
- Next by Date: Re: CIF-JSON draft 2017-05-08
- Prev by thread: Re: CIF-JSON draft 2017-05-08
- Next by thread: Re: CIF-JSON draft 2017-05-08
- Index(es):