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

bring back reload #25720

Open
vtjnash opened this issue Jan 24, 2018 · 5 comments
Open

bring back reload #25720

vtjnash opened this issue Jan 24, 2018 · 5 comments
Labels
feature Indicates new feature / enhancement requests help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@vtjnash
Copy link
Member

vtjnash commented Jan 24, 2018

Deprecating reload("Compat") to Base._require(Base.PkgId("Compat")); Base.root_module(Base.PkgId("Compat")) has made this operation much harder to type. Revise.jl is great, but it doesn't seem essential to remove this function entirely. I don't think we're planning on making this impossible?

reopens #18659

@StefanKarpinski
Copy link
Member

StefanKarpinski commented Jan 24, 2018

It reload is only ever called in top-level code, it's fine for it to be single-argument like this. If anyone uses it from within a dependency to reload one of its dependencies, however, it's going to possibly load the entirely wrong thing. If that's thoroughly documented, we can reintroduce the function. However, I think this is a good time to ponder if we really want this – what are we really trying to accomplish when we reload something – and if we can accomplish that in a better way.

@StefanKarpinski
Copy link
Member

I think the API for this should probably be calling reload(ABC) where ABC is the package module object and it should be an error to pass a module that's not a root module (aka a package). That API cannot be misused so easily. Similarly, I think that APIs where someone wants the path to some package code should take the module object since that will work regardless of the context.

@StefanKarpinski
Copy link
Member

Open question: if LOAD_PATH and DEPOT_PATH have changed since ABC was originally loaded, should reload(ABC) reload the code at the original location or load the version that a fresh import ABC would load based on what's currently in the path variables?

@vtjnash vtjnash added the regression Regression in behavior compared to a previous version label Jul 24, 2018
@vtjnash
Copy link
Member Author

vtjnash commented Jul 24, 2018

I don't care at all, since it'll never matter. Just make it work.

@StefanKarpinski StefanKarpinski added feature Indicates new feature / enhancement requests help wanted Indicates that a maintainer wants help on an issue or pull request and removed regression Regression in behavior compared to a previous version labels Jul 24, 2018
@cossio
Copy link
Contributor

cossio commented Oct 16, 2018

Open question: if LOAD_PATH and DEPOT_PATH have changed since ABC was originally loaded, should reload(ABC) reload the code at the original location or load the version that a fresh import ABC would load based on what's currently in the path variables?

It seems to me that reload should always emulate what a fresh import ABC would do.

The Revise workflow has important limitations. It cannot handle type changes or changes in dependencies of loaded modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates new feature / enhancement requests help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants