Proposal / Question - Embedded Empty Object & Undefined Operators #30
Replies: 4 comments 7 replies
-
I do want to mention:
I wanted to separate the truthiness portion from the inline portion:
|
Beta Was this translation helpful? Give feedback.
-
Objects are unordered so there is no "first" key. More critically, some languages are non-deterministic when iterating over object keys, and you'll never be able to determine a "first" key. |
Beta Was this translation helpful? Give feedback.
-
Self +1. Current Votes
|
Beta Was this translation helpful? Give feedback.
-
Not really for discussion here, but noting for Supporting multiple keys in an object carries with it a problem of evaluation order. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
In JSON Logic, we interpret objects as operator invocations.
Determines that the operator is
+
and invokes it with the arguments[1, 2]
We need to formally decide:
Proposal
Part A (Empty Objects)
I'd like to propose that empty object passes through, making it easy to use as a parameter or setting it up as a default parameter in a reducer.
Most implementations of JSON Logic handle empty object this way.
Part B (Unknown Operator)
I'd like to propose:
Something along the lines of
* The door is kind of open to consider multi-key operators in the future, but the operators selected are not intended for multi-key use, thus should fail.
Beta Was this translation helpful? Give feedback.
All reactions