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

Deprecate importall #22789

Closed
tkelman opened this issue Jul 13, 2017 · 10 comments
Closed

Deprecate importall #22789

tkelman opened this issue Jul 13, 2017 · 10 comments
Assignees
Labels
kind:deprecation This change introduces or involves a deprecation modules
Milestone

Comments

@tkelman
Copy link
Contributor

tkelman commented Jul 13, 2017

Simplest part of #8000.
This doesn't seem like it needs to be syntax, should be possible to implement as a macro instead, maybe even living in a package if Base can be made to not need it. importall is usually a code smell when used in packages - if a dependency adds an export that happens to use the same name that you were using for some previously-module-local function, then you'll start extending functions that you may not have meant to.

By my count there are only 5 uses of this in Base other than in sysimg.jl. It might be desirable as we try to modularize and shrink Base to also rethink the 23 uses of importall that are currently in sysimg.jl, to encourage using the submodules of Base explicitly, more like they were packages (which most of them should be) rather than all part of the flat top namespace of Base.

@tkelman tkelman added needs decision A decision on this change is needed kind:deprecation This change introduces or involves a deprecation modules labels Jul 13, 2017
@JeffBezanson
Copy link
Sponsor Member

I believe most uses in Base are actually instances of re-exporting (#1986). Probably some are unnecessary, and some are undesirable and the modules should be more separated.

@StefanKarpinski StefanKarpinski added this to the 1.0 milestone Jul 18, 2017
@JeffBezanson
Copy link
Sponsor Member

We should possibly move Reexport.jl into Base.

@ararslan
Copy link
Member

ararslan commented Sep 6, 2017

One issue I've found in writing the macro that would replace importall is that ..A doesn't parse except in the context of using/import/importall, so removing all special casing of importall would make it impossible to do relative importing (at least using the existing syntax).

@JeffBezanson
Copy link
Sponsor Member

I think we can do without a macro replacement. I don't think there are any cases where importall is really needed.

@KristofferC
Copy link
Sponsor Member

Very much agree.

@ararslan
Copy link
Member

ararslan commented Sep 6, 2017

Actually I guess the deprecation target for importall should just be using, especially if we want to encourage (and possibly require) module qualification for extending.

@zsunberg
Copy link
Sponsor Contributor

I think we can do without a macro replacement. I don't think there are any cases where importall is really needed.

There is a use case for it - when you are trying to implement an interface defined in another package for a type that you created. People use this all the time with POMDPs.jl to make problem implementations cleaner (and we encourage it). Not saying that this decision is necessarily wrong, but I am sad to see it go.

I guess we'll make our own macro that does it specifically for POMDPs.jl...

@StefanKarpinski
Copy link
Sponsor Member

It might make more sense to have an ImportAll package that defines an @importall macro.

@NTimmons
Copy link

Here you go: ImportAll.jl

I needed this for a remapping project.

@zsunberg
Copy link
Sponsor Contributor

Thanks @NTimmons

c42f added a commit to c42f/Tokenize.jl that referenced this issue Dec 9, 2021
This keyword hasn't existed since before Julia 1.0
JuliaLang/julia#22789
c42f added a commit to c42f/Tokenize.jl that referenced this issue Dec 29, 2021
This keyword hasn't existed since before Julia 1.0
JuliaLang/julia#22789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:deprecation This change introduces or involves a deprecation modules
Projects
None yet
Development

No branches or pull requests

7 participants