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

compatibility code for v1.0 #22

Open
vtjnash opened this issue Sep 12, 2018 · 2 comments
Open

compatibility code for v1.0 #22

vtjnash opened this issue Sep 12, 2018 · 2 comments

Comments

@vtjnash
Copy link
Collaborator

vtjnash commented Sep 12, 2018

I've written this snippet of code for inclusion in PackageCompiler.jl, but it feels like it should belong somewhere here.

let M = Module() # Prevent this from putting anything into the Main namespace
    # get a local reference to any module that may be directly referenced in the `precompile.jl` file
    for m in Base.loaded_modules_array()
        Core.isdefined(M, nameof(m)) || Core.eval(M, Expr(:const, Expr(:(=), nameof(m), m)))
    end
    for n in names(Main)
        if Core.isdefined(Main, n) && isconst(Main, n)
            m = getfield(Main, n)
            m isa Module && (Core.isdefined(M, nameof(m)) || Core.eval(M, Expr(:const, Expr(:(=), nameof(m), m))))
        end
    end
    Base.include(M, \"precompile.jl\")")
end # let
@vtjnash vtjnash changed the title compatibility code for v0.1 compatibility code for v1.0 Sep 12, 2018
@timholy
Copy link
Owner

timholy commented Sep 20, 2018

Where would you see it integrating?

@vtjnash
Copy link
Collaborator Author

vtjnash commented Sep 20, 2018

I'm not sure—it just seemed useful to have a canonical source of this functionality, for enabling the use of precompile.jl files on v1.0.

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