Skip to content

Omission of imports #37925

@jonas-schulze

Description

@jonas-schulze

Use Case 1: import all exported names except a few

Currently, the only way around that is to either qualify all uses or to list all names explicitly in a using statement. This becomes cumbersome if the list of names or their uses is long. It would be nice if we could do something like

using Base
hiding Base: pipeline
# or
using Base hiding: pipeline

that imports all symbols from Base but pipeline.

Use Case 2: resolve naming conflicts (edit: resolved)

When there are functions with identical names but different meanings, this would be useful to resolve naming conflicts. Here, I think, the first syntax would be better/clearer as the intent is to hide/un-export a symbol (since using Base is usually already being done implicitly):

using HTML
hiding Base: div

See also https://discourse.julialang.org/t/base-div-vs-html-div-specialize-or-not/47776/17

Edit: There's already a way around that, see #37925 (comment):

using HTML
using HTML: div

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions