-
-
Couldn't load subscription status.
- Fork 463
-
Hello,
Let's say we have a complex long expression which evaluates to a boolean value. How do we figure out which part "broke" it? i.e. which part led the evaluation to result into false?
For e.g.
let result = Func1() && Var1 == "X" && Func2(Var2) && (Var3 in [x,y,z] || var4 in [a,b,c]);
return result.Value, result.Reason
The above expression might give some idea on the expectation. The result.Reason can be Func2(Var2) is false (let's say).
Thinking out loud here. Do you think this is achievable? I understand that what reason means for one might not mean for someone else. Though, we can try to make it deterministic in some way.
But do you think this is possible?
Thanks,
Rohan Chougule
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
You can use Explain mode from Expr Pro:
image
This way, it is possible to see exactly why expression "broke"
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh, it's a paid feature. Got it.
Though, how will it exactly work via code? Any examples? Will I get a list of these "steps" when I invoke expr.Run?
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, exactly. You provide code as a string and env object. On output - list of steps as strings.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1