Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CIF-JSON draft 2017-05-08

> 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]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.