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

Do not export names of imported modules #20

Open
mschubert opened this issue Nov 7, 2014 · 3 comments
Open

Do not export names of imported modules #20

mschubert opened this issue Nov 7, 2014 · 3 comments
Labels

Comments

@mschubert
Copy link
Owner

Right now, if in module a:

b = import('b')

then

a = import('a')
ls(a)

lists b, even though you would not want to access the module that way.

A way around this would be to (in module a) use:

.b = import('b')

Should we use this for all module-internal imports?

@klmr
Copy link
Contributor

klmr commented Nov 8, 2014

Good point. I implemented this design in analogy to Python, and also because it’s simply the obvious implementation, everything else would require a convoluted workaround, and it would make it non-obvious.

We could try using .-prefix throughout.

@klmr klmr added the question label Nov 8, 2014
@klmr
Copy link
Contributor

klmr commented Nov 14, 2014

In fact, we may want to revisit our no-attach policy. Yes, it’s standard in Python. But on the other hand, we attach differently than from Python (in particular, attached objects are not exported from the module), so surgically attaching modules would result in less scope leakage than what we are doing at the moment.

@mschubert
Copy link
Owner Author

The main reason for me to not use attach is to make it explicit which module a certain function resides in. This, in my opinion, is so much more readable than to keep track of which functions shadow which given multiple attached objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants