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
creload does not follow include correctly in Juno #3
Comments
Thank you for the report! I haven't been able to reproduce the problem so far. What is the error message? Are 1.jl and 2.jl in the same directory as the A module file? Do you manually push the module's directory onto LOAD_PATH, or is it in your On my system, running |
Yes I manually add the module path to LOAD_PATH . In .julia/v0.5 I have I am working on a project(AR glasses) I have more than one conceptual So it is not logical for me to work as a package developer for Julia would Anyway .. I was looking through your code and I think that if you include I tried to meddle with your code but I am not that proficient and my :-) Alright then , enjoy the weekend. On Friday, 30 September 2016, Cédric St-Jean notifications@github.com
|
My personal project is also on LOAD_PATH (not in the "current" directory), contains 4-5 includes, and
If the Macroexpanding everything sounds appealing, but in my experience it's a huge rabbit hole, and I would rather not go there. In particular, if the module is defined and called in the same file, merely calling BTW, if you're creloading many modules, it's important to
Cool, where do you work? |
It seems that the problem is related to Atom and Juno and not to your code where B is a file under folder test\ in my project directory .. But if I am using the julia builtin REPL it works as expected and finds Cool, where do you work? I recently started working with a new startup, in Israel, bringing AR into On Fri, Sep 30, 2016 at 5:44 PM, Cédric St-Jean notifications@github.com
|
Juno already has some functionality for reloading modules, as you probably know, and it's likely to interfere with ClobberingReload. Could you try running |
The directory is correct .. but somehow the whole evaluation is considered For example if I call creload from Juno Repl I get an error If I call creload by "including" a script to reload all my modules I get an I workaround this by having a macro that prepends the full path to module On Monday, 3 October 2016, Cédric St-Jean notifications@github.com wrote:
|
@MikeInnes Any idea why this code wouldn't work in Juno-atom? I took the function creload(mod_name)
mod_path = Base.find_in_node_path(mod_name, nothing, 1)
cd(dirname(mod_path)) do
# this will call readstring(basename(mod_path))
real_mod_name, code = parse_module_file(basename(mod_path))
eval(eval(Main, real_mod_name), :(begin $(code...) end))
end
end |
withpath("/path/to/module.jl") do
eval(:(include("x.jl"))) # correctly gets "/path/to/x.jl"
eval(:(@__FILE__)) # also now works correctly, etc.
end Also, you'll get closer to the original semantics of file loading if you evaluating top-level statements one at a time – that will solve problems with macro definitions and such. I think you can get this as easily as by using |
Thank you for the detailed answer. @TsurHerman I've implemented Mike's suggestions. If you want to give it a try, |
Thanks :-) yes I will give it a try . |
@TsurHerman Did it fix the issue? |
Hi! Sorry for the late answer, I think so .. but I am since using auto generated full path , so I can't really tell. |
Ok, I'll close it for now; reopen if it's still an issue. |
If my module is in a different directory , and it includes several files
i.e
module A
include("1.jl")
include("2.jl")
end
then creload fails to parse the file correctly.
As a workaround I use full paths. Thanks again for your work
The text was updated successfully, but these errors were encountered: