Skip to content
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

Fix macro hygiene #311

Closed
pdeffebach opened this issue Nov 22, 2021 · 4 comments
Closed

Fix macro hygiene #311

pdeffebach opened this issue Nov 22, 2021 · 4 comments

Comments

@pdeffebach
Copy link
Collaborator

I need to not esc everything at once. See discussion here.

@pdeffebach
Copy link
Collaborator Author

Here is the problem in particular:

julia> using DataFrames

julia> using DataFramesMeta: @transform

julia> df = DataFrame(x = [1, 2]);

julia> @transform df :y = :x .+ :x .^ 2
ERROR: UndefVarError: DataFramesMeta not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/DataFramesMeta/yzaoq/src/macros.jl:1190

The offending line is here.

Unfortunately I really don't know what to do in this exact instance, since this call is pretty deeply nested inside a helper function shared by everything. I can't just copy and paste it into each macro call. cc @jkrumbiegel , do you have any ideas on a fix?

@mcabbott
Copy link

The error from that line can probably be fixed by :($make_source_concrete($(Expr(:vect, t...)))), but I haven't tried.

@pdeffebach
Copy link
Collaborator Author

Cool that seems to have fixed it. Great, I was worried that I would be really out of luck. I will make a PR for this after I merge #307

@pdeffebach
Copy link
Collaborator Author

Fixed in #384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants