Recursive evaluation? #43
Replies: 2 comments 8 replies
-
|
In my implementation, I've added a flag named "preserve_structure" which can be enabled when constructing the engine object. The engine preserves object structure and evaluates only valid logic throughout the data. Please use playground and enable the check box "Preserve Structure", without it the engine throws error. {
"dateRange": {
"start": {
"var": "startDate"
},
"end": {
"var": "endDate"
}
}
}Data: {
"startDate": "2025",
"endDate": "2026"
}And the result is: {
"dateRange": {
"end": "2026",
"start": "2025"
}
}I hope this is what you are referring to. |
Beta Was this translation helpful? Give feedback.
-
|
Historically, I've done this three different ways, Back in 2020 when I implemented
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I hit an interesting case which fully depends on the implementation - some try to be more clever than others there.
High level I want to create this kind of instance
{dateRange: {start, end}}with start and end coming from variables (the context/data).The issues are:
dateRangeis not an operator (so some impl will fail, others will see it is not in the operation registry and passthrough)Think it can be worth having some handling of these cases in the final spec.
My workarounds are to use the "clever" impl for operators (so
is_logicis patch if we use the js impl as a ref) and to have arecursivekind of operation to deep evaluate the subtree but I'm not that happy with it even if it opens the doors I need.Beta Was this translation helpful? Give feedback.
All reactions