-
Notifications
You must be signed in to change notification settings - Fork 869
Clarify inline tables are immutable (and dotted keys can't "inject" into them) #630
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
Comments
Also include below (if I am right): a = {}
[a.b] |
This isn't valid. This is injecting a "b" key into an inline table defined "a". |
That would make a good counterexample for the spec, though. How about this? Inline tables are immutable. Once they are defined, new elements and subtables cannot be added to them.
I would avoid saying the word "inject." "Immutable" carries plenty of weight, so making that meaning clear ought to be sufficient. |
I'm going to have to change the wording. We don't want anyone to think that, when TOML is loaded into a data structure in a program, that the data structure must be immutable. Granted, it's not recommended to modify a configuration in a program. But what the program does with it is outside the scope of the specification. Once inline tables are defined, their values are fully set, and new elements and subtables cannot be added to them. a = {}
#a.b = 1 # INVALID
#[a.b] # INVALID |
You can't "inject" into inline tables with dotted keys. This isn't clear in the specification and we should clarify.
The text was updated successfully, but these errors were encountered: