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

@exfiltrate VARS doesn't work inside module/package #1

Open
ianfiske opened this issue Aug 27, 2020 · 3 comments
Open

@exfiltrate VARS doesn't work inside module/package #1

ianfiske opened this issue Aug 27, 2020 · 3 comments

Comments

@ianfiske
Copy link

Thank you for Exfiltrator! This package is beautiful and is making debugging Julia so much easier for me. I have encountered a problem though that where as the basic Main.@exfiltrate works fine from within package functions, the expanded syntax Main.@exfiltrate VARS doesn't seem to do anything. It does work fine in test functions outside of a package.

Here's an example where it does nothing:

using Exfiltrator

module MyMod

function f(x)
    Main.@exfiltrate vars
    2x
end

end

MyMod.f(1)

And then there is no vars in the Main workspace.

@ianfiske
Copy link
Author

Interestingly, it does look like it put vars inside the MyMod module.

@antoine-levitt
Copy link
Owner

Ah, that's right, that's because global x only declares x global within the current module? In that case the setfield!! function should be used, as in the exfiltrate() method: https://github.com/antoine-levitt/Exfiltrator.jl/blob/master/src/Exfiltrator.jl. If you're motivated enough to make a PR that'd be great, otherwise I'll get to it eventually (but no promises on when)

@ianfiske
Copy link
Author

Thanks for the explanation. Will take a look at making a PR when I have some time to sharpen my metaprogramming skills.

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