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
@liamhuber Maybe we should talk whether this is a valid way of using nested for loops, because we could also argue that arange should be written as a list of lists instead of a simple list.
I'm copying your comment here, because #341 itself is A-OK from a technical perspective and I don't want to clutter that.
I did a quick check of my gut hypothesis, and this really is fundamentally only a label tracking issue; if we reassign a fresh symbol to the list before reusing it, the code parses and runs completely fine:
So if it would run with a trivial relabel, I definitely consider it a bug that it won't run without one.
To directly address your concern, in this case writing arange as a list of lists would be memory wasteful, since each sub-list would be identical. We can make the inner list depend on the outer list by replacing b = sub(w, x) with b = sub(w, v), at which point it becomes meaningful and interesting to have made a nested iteration over the same source data twice.
At the end of the day, I'm coming down solidly on the side that this is a real parsing bug and we might as well patch it.
Activity
liamhuber commentedon Oct 22, 2026
I'm copying your comment here, because #341 itself is A-OK from a technical perspective and I don't want to clutter that.
I did a quick check of my gut hypothesis, and this really is fundamentally only a label tracking issue; if we reassign a fresh symbol to the list before reusing it, the code parses and runs completely fine:
So if it would run with a trivial relabel, I definitely consider it a bug that it won't run without one.
To directly address your concern, in this case writing arange as a list of lists would be memory wasteful, since each sub-list would be identical. We can make the inner list depend on the outer list by replacing
b = sub(w, x)withb = sub(w, v), at which point it becomes meaningful and interesting to have made a nested iteration over the same source data twice.At the end of the day, I'm coming down solidly on the side that this is a real parsing bug and we might as well patch it.