-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Level-based Arrays #93
Comments
@3F FWIW,
because such 'expand operation' alter the original amount of the keys. The config contains one |
@PSVortex I'm not agree. An 'expand operation' is applicable only for transition state. But this suggestion is just about final nodes/levels. Means also that backward representation is not main task for this issue. It should be resolved more like separately because of possible ambiguities. Anyway, this is superset that can just independently extend ECMA-404 blind spots. About complexity is a good question. And I don't think that mentioned extra logic is more complex than currently implemented multiline strings. In O notation it should be exactly like O(n) that more like equality to basic array behavior. That is, we can just accumulate data as we go down to the end of active level. |
@PSVortex Wait, I just noticed possible misunderstanding with your issue #92:
This suggestion, however, is just additional layer for data representation such as today's all possible strings in Hjson. Your issue was noticed by me just for related things. That's why I do not mean any transitional states above. |
Due to issue #92, We can talk more about various array-type representation in Hjson spec.
My suggestion is to extend the representation of arrays as the Level-based Arrays.
For example, duplicated keys can be considered such as:
That's much more closer to classic arrays [...].
Level-based Arrays
Hjson spec may wrap duplicated keys as an simple 'Level-based' Arrays.
level
means each separated object that can represent its own level. That is, not only the top-level/root object.The main pros: It can be easily represented in other JSON-based specifications with backward compatibility. While it still can be manageable under specific implementation (because it will be considered as array type that will help to avoid errors as in #92).
draft1
Let's consider the following normal case without duplicates.
Hjson-notation:
JSON-notation:
And the following possible duplicated keys:
Where 'Level-based Arrays' still can be represented in JSON-notation like:
Backward representation and its ambiguities
The main task is to consider backward representation for something like this:
Because it can also be understood as:
But I think we can also review this part easily due to specific types etc (did not think much for more abstraction, just first thoughts after #92).
Please also note: [?] Backward representation is not main task for this issue.
Other problems
TODO:
Cc: @dqsully
The text was updated successfully, but these errors were encountered: