-
Notifications
You must be signed in to change notification settings - Fork 11
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
Could @everywhere
support using macros from packages that are loaded in the same block?
#83
Comments
I think this is just how macros work, they get expanded before any code is executed. So if code in the block defines the macros then expanding the macro itself in that block can't be done. Not sure what can be done about this. |
This is not related to Distributed either
|
It might be we just need to document this. but maybe we can do better. -- I would kind argue that this remains related to Distributed. I know Alternatively, could we just remove the begin block on what gets run on the workers so it truely runs at global scope? |
Yes — obviously there's not much we can do about the general case without a huge reworking. But inside the |
@everywhere
support using macros from packages that are loaded in the same block?
So there is a link i think we can basically take |
Also, we can consider the case of meta-programming, trying to execute
inside |
We could rewrite the block Expr to have a head of toplevel. That changes it to sequential execution. But note the side effect of sequential execution is that local variables and scope declarations don't flow from one line to the next (which is what allows the delayed macro expanding to work) |
I rapidly tried to write a macro combining |
Consider the following (with TimeZones.jl installed in global enviroment),
This should be valid as far as I know.
This failed in julia 1.6, but i think i first noticed this many many versiions ago
In contrast
works just fine.
Similar failure occurs with normal macros, e.g.
The text was updated successfully, but these errors were encountered: