On 2016-07-01 11:26, Monte Goulding wrote:
From the perspective of mergJSON it would be simpler to convert it to lcidl based and therefore set variables to specific data types than to do what you are suggesting here as there’s simply no access to the strings from Jannson.
Indeed - that would put it in the same class of operation as the LCB JSON library.
To be fair, I *suspect* the outcome would be entirely equivalent for any use of the input data where the numberFormat is configured to show less than around 15 decimal d.p. - which you should never exceed anyway, since that's the limit of what can be represented without error.
The main reason the 'decimal-as-string' idea might be 'nice' is that it allows faithful roundtripping of values in a JSON array. For example, if your program is only processing parts of an array generated from a JSON file and then writing it back out again, at the moment all numbers would get reformated as though they'd been round-tripped through doubles, if the conversion to double is done lazily (i.e. only if they are processed and set again) then only the parts of the file which need to change do change. (Of course, the structure of the JSON file in terms of whitespace wouldn't be preserved, however it would mean that the file as a whole would be stable apart from modified values after the first time it was passed through the processing program).
Warmest Regards, Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode