Open umuro opened 2 years ago
@berekuk This issue can be fixed at the parser level
How? I know you could rewrite these as ternaries, but that would conflict with plans from #1107.
Maybe it makes sense to do the rewrite as ternaries on peggyNode -> expression step, though. Or we could just add these as expression variants, I don't really mind having one or two more branches in Reducer_Expression.evaluate
.
Creating Peggy nodes for them, then converting to ternary expressions. As you say. Adding such simple cases as expression variants is not necessary. Keeps the interpreter clean
On Tue, Oct 4, 2022, 17:40 Vyacheslav Matyukhin @.***> wrote:
How? I know you could rewrite these as ternaries, but that would conflict with plans from #1107 https://github.com/quantified-uncertainty/squiggle/issues/1107.
Maybe it makes sense to do the rewrite as ternaries on peggyNode -> expression step, though. Or we could just add these as expression variants, I don't really mind having one or two more branches in Reducer_Expression.evaluate.
— Reply to this email directly, view it on GitHub https://github.com/quantified-uncertainty/squiggle/issues/559#issuecomment-1267199725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALOF6OJRMGYCF2WRLWSWLWBRFWBANCNFSM5WPTZ3OA . You are receiving this because you were assigned.Message ID: @.***>
In the current implementation logical operators are not lazy. However, all logical operators need to evaluate their second argument based on the value of their first argument. Example
false && truth(b)
should not executetruth(b)
at all.