We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FromBuilder
FromBuilder should remove intermediate renames. Consider
from i in [1, 2], j in [3, 4], k in [5, 6] yield {a = j, b = i} where a + b = 5
This can be converted to
from i in [1, 2], j in [3, 4], k in [5, 6] where j + i = 5 yield {a = j, b = i}
The yield {a = j, b = i} is removed; all occurrences of a after the yield are replaced with i, and all occurrences of b are replaced with j.
yield {a = j, b = i}
a
i
b
j.
A final yield is added to ensure that the from expression still has type {a:int, b:int} list.
yield
from
{a:int, b:int} list
The variable k is dead after the yield, and must not be used. (Do we need to add a new subclass of Core.FromStep to kill variables?)
k
Core.FromStep
The text was updated successfully, but these errors were encountered:
Another optimization:
from d in dept join loc in [d.loc] yield loc
should become
from d in dept join yield d.loc
The singleton join loc in [d.loc] should be seen as a project, yield {d, d.loc}, and therefore it can be merged with the following yield loc.
loc in [d.loc]
yield {d, d.loc}
yield loc
Sorry, something went wrong.
No branches or pull requests
FromBuilder
should remove intermediate renames. ConsiderThis can be converted to
The
yield {a = j, b = i}
is removed; all occurrences ofa
after the yield are replaced withi
, and all occurrences ofb
are replaced withj.
A final
yield
is added to ensure that thefrom
expression still has type{a:int, b:int} list
.The variable
k
is dead after the yield, and must not be used. (Do we need to add a new subclass ofCore.FromStep
to kill variables?)The text was updated successfully, but these errors were encountered: