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

Documentation for local modules is incomplete #45887

Open
barker29 opened this issue Jul 1, 2022 · 2 comments
Open

Documentation for local modules is incomplete #45887

barker29 opened this issue Jul 1, 2022 · 2 comments
Labels
docs This change adds or pertains to documentation

Comments

@barker29
Copy link

barker29 commented Jul 1, 2022

The manual for modules offers the following example code:

module NiceStuff

export nice, DOG
struct Dog end      # singleton type, not exported
const DOG = Dog()   # named instance, exported
nice(x) = "nice $x" # function, exported

end

using NiceStuff

But running it produces the following error:

ERROR: LoadError: ArgumentError: Package NiceStuff not found in current path:
- Run `import Pkg; Pkg.add("NiceStuff")` to install the NiceStuff package.

Stacktrace:
 [1] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:967
in expression starting at /home/username/julia-modules/try.jl:14

In face using NiceStuff needs to be replaced with using .NiceStuff, but this is not documented anywhere. Documentation for the using and import statements just refer to the modules section of the manual.

Similarly, the description of "Package directories" in the manual section on code loading appears to be incomplete. I cannot get a julia script to import a julia module from a file in the same directory tree using any of the three locations for entry points that are provided in the manual. An example of how exactly to set up julia files that import each other as modules without building a manifest file would be very helpful.

This is related to #26910 but is not exactly the same.

@fredrikekre
Copy link
Member

At least some parts of this was adressed by #41398.

@fredrikekre fredrikekre added the docs This change adds or pertains to documentation label Jul 1, 2022
@barker29
Copy link
Author

barker29 commented Jul 1, 2022

@fredrikekre You're right, the old docs are still live on the website and the issue is closed so my search didn't find this.

The thing remaining here is the section on code loading. I can't follow the instructions there to get "Package directories" to work at all as the docs suggest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

2 participants