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

using and import incorrectly reports that file is unavailable #4492

Closed
dpsanders opened this issue Oct 12, 2013 · 6 comments
Closed

using and import incorrectly reports that file is unavailable #4492

dpsanders opened this issue Oct 12, 2013 · 6 comments

Comments

@dpsanders
Copy link
Contributor

I have just updated to the latest version.
When I try to use import or using, they (sometimes?) incorrectly report that the file does not exist (at least, this is my interpretation), even though the objects defined there then work correctly:

julia> using interval
ERROR: in module path: interval not defined

julia> Interval(1, 2)
[1, 2]

Later imports also seem to report this error.

julia> versioninfo()
Julia Version 0.2.0-prerelease+4018
Commit 9b127c4 2013-10-12 17:31:51 UTC
Platform Info:
  System: Darwin (x86_64-apple-darwin12.4.0)
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm
@StefanKarpinski
Copy link
Member

This seems likely to be an OS X case-sensitivity issue.

@simonster
Copy link
Member

I think this happens if interval.jl doesn't actually contain a module named interval. In that case the right approach is to require("interval"), but maybe we want a better error message for this.

@StefanKarpinski
Copy link
Member

Yes, this definitely should have a better error message.

@dpsanders
Copy link
Contributor Author

So there is import, using and require? That seems rather confusing.

In this case, it is reporting an error and proceeds to import the definitions in the file anyway!

@StefanKarpinski
Copy link
Member

If you name the file and the module to match, you don't have to use require. It's pretty rare to see require these days.

@dpsanders
Copy link
Contributor Author

The file does not contain a module, just the type and function definitions; maybe this is the basic problem then? Is this an unsupported use?

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

3 participants