-
Notifications
You must be signed in to change notification settings - Fork 3
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
types in keys instead of values? #28
Comments
The main problem with this approach is the handling of arrays. Presently the root symbol of the grammar allows both objects and arrays as nonterminals. This syntax is incompatible with toplevel arrays, as they wouldn't carry any type information. A potential solution to that is to disallow toplevel arrays and require them to be wrapped in an object. The type information encoded in the key would apply to all members of an array. (Sidebar: homogeneity of types in non-scalars is discussed in #23) This still doesn't resolve the issue for nested arrays, however. Perhaps arrays could carry some type information in their first member, an approach suggested by @benlaurie in #22. |
I created a concrete proposal for this approach here: #30 |
Fixed in #35 |
have you considered storing types in keys instead of values? if so, what was the reason not to use that? pros are it would avoid string copying because of substring slicing in many languages (before decoding), and the tag would live on the "structure level" (the keys), not the "value level".
(it would not allow for mixed content arrays of strings but that is bad anyway for other reasons.)
The text was updated successfully, but these errors were encountered: