-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Cant find module in CWD if module name is different from the filename #18630
Comments
This is how If you want to load include("AAA.jl") # execute everything in AAA.jl, which imports the BBB module
using BBB # import the exported symbols from the BBB module |
|
You get |
I suggest the following for better readability on the expense of maybe less usability : include("A.jl") -> evaluate contents A.jl in the current scope |
@TsurHerman, that would be quite a large departure from how Julia works. (Furthermore, your proposal swaps the meaning of |
Thanks for clearing it out .. it should be stated somewhere very clearly that import and using first perform include modulename.jl. There should be a way to work more naturally when developing. I am currently using 'import' only on my code since I reload it often using a convenient macro @! So there must be a way to tag each symbol with the module it came from, and to further more automatically monitor the file system for changes and to reload modules and invalidate affected symbols. This behavior can be only in interactive mode as probably it has some effect on performance. So far my initial experience with julia is excellent. |
I fumbled with that .. and didn't see any benefit over reloading my modules the normal way. I really like Julia but the infrastructure is lacking and some of the available packages are still immature and not properly maintained. A maintained small and simple package is much better than an obscure generic code wizardry. |
AFAICT there's nothing that needs to be done here. (Top level) Modules that are loaded automatically are always required to have the same module name and file (base)name. The confusion of getting a different module in |
using julia 0.5rc4
LOAD_PATH contains current directory.
I have a filename AAA.jl defining en empty module BBB.jl
in a new shell
Another peculiarity, if I try an import using the filename , then the second time it works:
The text was updated successfully, but these errors were encountered: