You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The analysis could indeed be more precise around mutable variables. It might require changing the structure of the checker a little. I think it's currently a single-pass thing, and that wouldn't work anymore. The checks would have to be moved to the end of a block.
Additionally I think that it is quite limiting not being able to execute conditionals on non-local values, why is that ?
Two for keeping control local to a stanza reasons here:
It makes reasoning about stanza behavior much easier. The shape of the graph that is created by a stanza is completely determined by the nodes that were matched.
It keeps the implementation simpler. Stanza's can be reduced to graph statements and expression thunks that can be lazily evaluation. That ensures that stanza evaluation order doesn't matter. If we wanted to allow conditionals on non-local values, we'd have to push allt he control logic into the lazy expressions. It's possible, but the implementation becomes quite complex.
The following tsg stanza, while executed on an empty python file:
Will error:
Where it would work just fine with an immutable "let":
Will print "a is true" as expected.
This is a weird behavior, as a should have the same scope in both cases. It also prevents to do patterns such as:
Additionally I think that it is quite limiting not being able to execute conditionals on non-local values, why is that ?
The text was updated successfully, but these errors were encountered: