Skip to content

don't load packages into Main by default? #17997

Closed
@JeffBezanson

Description

@JeffBezanson

This came up recently and there doesn't seem to be an issue about it.

The problem is that Main is both the default interactive namespace, and the "root" namespace used for loading packages. For example, say we have

module A
using B
end

If I do using A at the prompt, I also see B defined. However when other modules do using A they don't see B at all. (Note this does not have the same effect as using B at the prompt; you only see the symbol B itself, and still can't see things from inside B.)

In the original implementation of modules in 2012 there was a module called Root where packages were loaded, and interaction happened in Root.Main. We decided this was more complex than necessary and changed it pretty quickly, just a couple months later I believe.

I don't feel like I have tripped over this issue much myself, but it bears discussing.

Metadata

Metadata

Assignees

Labels

breakingThis change will break codedesignDesign of APIs or of the language itselfmodulesneeds decisionA decision on this change is needed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions