Explain mode
I'd like to explain to users how a result was calculated:
Say we have this expression, this is what it would print out:
-
c + p / e + P / (n * e) -
2 + 100 / 250 + 2500 / (10 * 250) -
2 + 0 + 1 -
3
Nice idea, but currently I don’t a free time to wolf on it. Somebody else?
"wolf"? 🐺
Now working on profiler for Expr. Maybe it also can be used here.
I'd also really like to see this feature. I'm willing to help/try doing it myself, but I don't even know where to start. Care to give me some ideas to put me on the right path?
Start with opcode)
I have some progress on the feature:
-((2 - 5) ** 3) - 2 / (+4 - 3) + -2
-(-3 ** 3) - 2 / 1 + -2
--27 - 2 + -2
25 + -2
23
reduce(filter(map(map(6..9, # - 2), # * 2), # > 6), #acc + #, -2)
reduce(filter(map(map([6,7,8,9], # - 2), # * 2), # > 6), #acc + #, -2)
reduce(filter(map([4,5,6,7], # * 2), # > 6), #acc + #, -2)
reduce(filter([8,10,12,14], # > 6), #acc + #, -2)
reduce([8,10,12,14], #acc + #, -2)
42
foo < 0 or (bar > 10 and baz == 5) or (qux <= 1 and quux >= 10 and corge > 0.5)
1 < 0 or (99 > 10 and 50 == 5) or (25 <= 1 and 10 >= 10 and 5 > 0.5)
false or (true and false) or (false and true and true)
false or false or (false and true)
false or false
false
garply.a + fn(grault[0] + 1)
1 + fn(1 + 1)
1 + fn(2)
1 + 2
3
This sounds useful, @antonmedv 👍🏻
How does one get/see the output you've shared?
I’m working on this picture as part of Expr Pro package 📦
I will share results little bit later. It’s going to be an addition to Expr.
Explain mode is done!
Now it comes in Expr Pro extension: https://expr-lang.org/expr-pro