That's because of types are ascribed to the values. If we could pass around [1,,3] as Json, then the mapping can be improved; but in "regular languages" having arrays with holes is questionable.
It's not about arrays with holes. JSON for them will have null instead of a hole. That's not the same as {0: 1, 2: 3}. Arrays have length and order of elements.
Maybe I am a bit slow, but yes, we can ascribe properties to certain objects. But you need to encode those properties so that you can restore them upon decoding. Like in JSON those properties are encoded by using square brackets. In a flat structure everything looks the same, so you need to invent markers, like extra constructed fields (length? plus _isArray?).
I recall what stunts people adopt to read a list of properties from Java's .properties files, which _are_ flat. :-)
no subject
Date: 2017-04-06 08:40 pm (UTC)If we could pass around [1,,3] as Json, then the mapping can be improved; but in "regular languages" having arrays with holes is questionable.
no subject
Date: 2017-04-06 09:14 pm (UTC)Maybe I am a bit slow, but yes, we can ascribe properties to certain objects. But you need to encode those properties so that you can restore them upon decoding. Like in JSON those properties are encoded by using square brackets. In a flat structure everything looks the same, so you need to invent markers, like extra constructed fields (length? plus _isArray?).
I recall what stunts people adopt to read a list of properties from Java's .properties files, which _are_ flat. :-)