-
Notifications
You must be signed in to change notification settings - Fork 101
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
sequence of 'phases' object in rt-app config is undefined - should use an array instead? #74
Comments
one could possibly make it backwards compatible by accepting either... (but prefer the array, as in, warn if it isn't one) |
If we want to go in this direction, not only "phases" should be an array but also each phase in "phases" as the events are ordered.
|
There's an implicit ordering assumption in parsing the json inside rt-app - we build the execution tree as events are delivered, and the parser we use always delivers the events in the order they are present in the source file. I don't really see much value in changing the syntax, but maybe we could document this expectation? |
yes, it's partially about the design working only accidentally:
there is also at least one actual limitation:
|
Is there anything I missed in the source code backing that ? From what I can see in
We use this
So the order is determined by the output of
So the
with a hash function for strings. New keys are added by the JSON parser to objects using EDIT: it does indeed preserve the order of insertion by maintaining a linked list of the items in the hash table: |
according to the JSON standard, the 'phases' object is unordered (http://www.json.org):
"An object is an unordered set of name/value pairs.[...] An array is an ordered collection of values. [...] A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested."
wouldn't it be necessary to use an array here, instead of:
so, instead of:
or
it would be
or
(updated the syntax above, because ironically i got it wrong..)
The text was updated successfully, but these errors were encountered: