include and eval for baremodule

what is the preferred way to define include and eval in baremodule?

I just stumbled upon this and was suprised, that the documentation does not say anything about how to restore this functionality. I just wanted to use another default for Base.+ and out of a sudden I am stuck with these missing defaults…

This seems ok

baremodule xbare; 
eval(x) = Base.eval(xbare, x)
include(x) = Base.include(xbare, x)

##from the outside versions
Base.eval(xbare, print("hello xbare"));
Base.include(xbare, "Somefile.jl")

thanks a lot,
yes I found it 2 minutes after I post this question…

of course I wanted to immediately delete the question,
but julia discourse does not let one because questions first go to review and are not visible at all in that phase…

Thank you very much for pointing out the solution!!

1 Like