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
Why can't typed containers be nested? #73
Comments
I'm pretty sure that typed containers can be nested. That was the final resolution of this thread #43 It resolved the "STCs must not contain other STCs" issue and said that what you just typed would in fact be valid. In fact, UBJ (my C language parser) handles your case already. Here is the relevant part of the spec: http://ubjson.org/type-reference/container-types/#optimized-format
|
Then this rule in the spec needs to be clarified:
It can be interpreted as “A container can have a ‘array’ or ‘object’ as its type, but those inner arrays or objects must not have types themselves”. If that’s not what it means, I actually have no idea what it does mean. Maybe that line should just be removed. |
It seems straightforward and means exactly what it says. It says that no type markers are inside the container for direct children, because the type is known (and must be constant) across the whole container type. |
I know typing will probably change in the next version, so this will be a moot point, but I’m still curious what I’m missing. It seems to me that something like
(that’s
[ [1, 2, 3], [4, 5, 6] ]
)is unambiguous and I can’t think of an ambiguous counterexample.
The text was updated successfully, but these errors were encountered: