-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
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
Undefined nested iterating variable #108
Comments
Yes, Polyester doesn't realize Line 94 in 5185467
|
I'm terrible at macros, so I will personally not be diving into that. ;-) |
I found that blocking the closure into it's own function is a general workaround. ie
|
Does that work on ARM? |
I don't have a computer with an ARM, so I can't check, sorry. The github CLI tests all passed but I'm not sure if any of those are ARM. |
Nevermind, seems to work fine on ARM. Still, this should be left open because workarounds or not, it is a real issue with the package. |
I found a similar problem when trying to loop over an iterable of functions: using Polyester
functions = [x -> n*x for n in 1:3]
data = rand(100)
@batch for i in eachindex(data)
for f in functions
data[i] += f(data[i])
end
end
# Yields 'ERROR: UndefVarError: `f` not defined' |
This simple example throws an error
ERROR: UndefVarError: j not defined
I can redefine the loop to get rid of the variable j in this case, but shouldn't this work in principle?
The text was updated successfully, but these errors were encountered: