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

require docstring is stale #27822

Open
KristofferC opened this issue Jun 27, 2018 · 4 comments
Open

require docstring is stale #27822

KristofferC opened this issue Jun 27, 2018 · 4 comments
Labels
doc This change adds or pertains to documentation packages Package management and loading

Comments

@KristofferC
Copy link
Sponsor Member

julia/base/loading.jl

Lines 831 to 851 in 53db863

"""
require(module::Symbol)
This function is part of the implementation of `using` / `import`, if a module is not
already defined in `Main`. It can also be called directly to force reloading a module,
regardless of whether it has been loaded before (for example, when interactively developing
libraries).
Loads a source file, in the context of the `Main` module, on every active node, searching
standard locations for files. `require` is considered a top-level operation, so it sets the
current `include` path but does not use it to search for files (see help for `include`).
This function is typically used to load library code, and is implicitly called by `using` to
load packages.
When searching for files, `require` first looks for package code in the global array
`LOAD_PATH`. `require` is case-sensitive on all platforms, including those with
case-insensitive filesystems like macOS and Windows.
For more details regarding code loading, see the manual.
"""
function require(into::Module, mod::Symbol)

     require(module::Symbol) 

doesn't match with the function signature it documents,

It can also be called directly to force reloading a module, regardless of whether it has been loaded before (for example, when interactively developing libraries).

is AFAIU not true,

Loads a source file, in the context of the Main module, on every active node, searching standard locations for files.

specifying Main here seems incorrect

@KristofferC KristofferC added doc This change adds or pertains to documentation packages Package management and loading labels Jun 27, 2018
@StefanKarpinski
Copy link
Sponsor Member

Should definitely be fixed but there's fairly low urgency since this is not an exported function.

@iamed2
Copy link
Contributor

iamed2 commented Sep 20, 2018

It's in the docs though: https://docs.julialang.org/en/latest/base/base/#Base.require

@StefanKarpinski
Copy link
Sponsor Member

Deleting it would be the quickest path to fixing the situation 😬

@henriquebecker91
Copy link
Contributor

henriquebecker91 commented Jan 18, 2020

Yet, it was not done in an year and half. I also have stumbled on this and complained in Discourse. In the end, i found the solution for my problem was to use an include_string(@__MODULE__, "import X"); invokelatest(method_that_uses_X, method_args...), so I am not sure require is really useful for an external user (not the Julia developers, I mean) in some case.

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

No branches or pull requests

4 participants