Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-12 Thread Tim Mackinnon
Once again, thanks for the interesting background to all of this (although I didn’t mean to cause so much discussion on the merits of the json spec). Anyway, I did check with the authors of Prismic.io - and they confirmed that their intent is that their document (schema?) does order block

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-12 Thread Herbert Vojčík
Richard O'Keefe wrote on 12. 6. 2018 3:54: Herbert Vojčík ​wrote " it is already part of the spec a few years already that enumeration on the object keys MUST respect the order in which keys were created". The JavaScript (ECMA-262) spec, not the JSON (ECMA 404) spec. The rest

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-11 Thread Richard O'Keefe
Herbert Vojčík ​wrote " it is already part of the spec a few years already that enumeration on the object keys MUST respect the order in which keys were created". I quoted two specs: json.org and the ECMA one. The current RFC for JSON is, I believe, RFC 8259, which says JSON parsing

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-11 Thread Herbert Vojčík
Norbert Hartl wrote on 11. 6. 2018 23:38: Am 11.06.2018 um 16:48 schrieb Richard O'Keefe >: I'm really baffled here. Look at the definition at json.org . ​An object is an UNORDERED set of name/value pairs. Or look at ECMA-404, which

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-11 Thread Richard O'Keefe
I'm really baffled here. Look at the definition at json.org. ​An object is an UNORDERED set of name/value pairs. Or look at ECMA-404, which json.org points to. The JSON syntax does not impose any restrictions on the strings used as names ... and DOES NOT ASSIGN ANY SIGNIFICANCE

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-11 Thread Tim Mackinnon
Yes i was a bit nervous about the ordering, but had also noticed other examples like this - but it is a good reminder for me to double check with the developers that they consciously have done this and to register an interest that it stays that way (particularly as they strangely don’t provide

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-11 Thread Tim Mackinnon
Sent from my iPhone > On 11 Jun 2018, at 08:02, Norbert Hartl wrote: > > > >> Am 11.06.2018 um 08:55 schrieb Richard O'Keefe : >> >> The order of key:value pairs in a JSON "object" >> is really NOT supposed to matter. For example, >> if you put {"a":1,"b":2} into a JSON database >> you

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-11 Thread Norbert Hartl
> Am 11.06.2018 um 08:55 schrieb Richard O'Keefe : > > The order of key:value pairs in a JSON "object" > is really NOT supposed to matter. For example, > if you put {"a":1,"b":2} into a JSON database > you should not be surprised to get {"b":2,"a":1} > back. Or vice versa, of course. > But

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-11 Thread Richard O'Keefe
The order of key:value pairs in a JSON "object" is really NOT supposed to matter. For example, if you put {"a":1,"b":2} into a JSON database you should not be surprised to get {"b":2,"a":1} back. Or vice versa, of course. On 8 June 2018 at 00:16, Tim Mackinnon wrote: > Thanks guys - it seems

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-07 Thread Norbert Hartl
> Am 07.06.2018 um 21:18 schrieb Esteban A. Maringolo : > > On 07/06/2018 13:59, Sven Van Caekenberghe wrote: >>> On 7 Jun 2018, at 14:42, Norbert Hartl wrote: >>> And safer. The current implementation of NeoJSONObject is not ver good. It >>> returns nil on any missing key so you mask a lot

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-07 Thread Esteban A. Maringolo
On 07/06/2018 13:59, Sven Van Caekenberghe wrote: >> On 7 Jun 2018, at 14:42, Norbert Hartl wrote: >> And safer. The current implementation of NeoJSONObject is not ver good. It >> returns nil on any missing key so you mask a lot of errors in your code >> which I find dangerous. > > Haha, it

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-07 Thread Sven Van Caekenberghe
> On 7 Jun 2018, at 14:42, Norbert Hartl wrote: > > > >> Am 07.06.2018 um 14:16 schrieb Tim Mackinnon : >> >> Thanks guys - it seems like I was on the right track. >> >> Making my own NeoJsonObject did work, but I will go back and see if I’m >> really using the js nature of the values

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-07 Thread Norbert Hartl
> Am 07.06.2018 um 14:16 schrieb Tim Mackinnon : > > Thanks guys - it seems like I was on the right track. > > Making my own NeoJsonObject did work, but I will go back and see if I’m > really using the js nature of the values and if for this, just an > OrderedDictionary might be clearer. >

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-07 Thread Tim Mackinnon
Thanks guys - it seems like I was on the right track. Making my own NeoJsonObject did work, but I will go back and see if I’m really using the js nature of the values and if for this, just an OrderedDictionary might be clearer. As an aside, I was doing some experiments with prismic.io (a

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-07 Thread Sven Van Caekenberghe
> On 7 Jun 2018, at 08:16, Norbert Hartl wrote: > > > >> Am 07.06.2018 um 07:29 schrieb Sven Van Caekenberghe : >> >> Tim, >> >>> On 7 Jun 2018, at 01:37, Tim Mackinnon wrote: >>> >>> Hi - I’ve hit some Json where the outputted values (they are field names) >>> are written out in a

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-07 Thread Norbert Hartl
> Am 07.06.2018 um 07:29 schrieb Sven Van Caekenberghe : > > Tim, > >> On 7 Jun 2018, at 01:37, Tim Mackinnon wrote: >> >> Hi - I’ve hit some Json where the outputted values (they are field names) >> are written out in a specific order - and the author hasn’t chosen to use an >> array to

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-06 Thread Sven Van Caekenberghe
Tim, > On 7 Jun 2018, at 01:37, Tim Mackinnon wrote: > > Hi - I’ve hit some Json where the outputted values (they are field names) are > written out in a specific order - and the author hasn’t chosen to use an > array to represent those fields in a specific order. > > { ‘field1’ : { ….},

Re: [Pharo-users] Is it bad to have an order NeoJsonObject?

2018-06-06 Thread Paul DeBruicker
Tim Mackinnon wrote > Hi - I’ve hit some Json where the outputted values (they are field names) > are written out in a specific order - and the author hasn’t chosen to use > an array to represent those fields in a specific order. > > { ‘field1’ : { ….}, ‘field2’: { … } } > > I think this is