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

Nested namespaces #361

Open
Night-walker opened this issue Feb 6, 2015 · 2 comments
Open

Nested namespaces #361

Night-walker opened this issue Feb 6, 2015 · 2 comments

Comments

@Night-walker
Copy link

test1.dao:

namespace one {x}

var x = 1

test2.dao:

namespace two {y}

load test1

var y = 2

Let's try it out:

(dao) load test2
= none
(dao) one
= namespace_19_0x8e4ea0
(dao) one.x
= 1

This is not how namespaces should function. Not how I expect them to, at least. If namespace one is not specified within namespace two {...}, it should not be exported further. And if exported, it should become two.one, respectively. Otherwise we cannot have 'service' namespaces intended for internal use (and which do not pollute the global namespace).

@dumblob
Copy link

dumblob commented Feb 6, 2015

I agree, that one and all it's members shouldn't be visible if loaded the way shown above (i.e. transitively), but I don't agree with the implicit two.one behavior. To be able to use two.one one needs to explicitly export the symbol one using e.g. namespace two {y, one} and it should stay this way.

@Night-walker
Copy link
Author

To be able to use two.one one needs to explicitly export the symbol one using e.g. namespace two {y, one} and it should stay this way.

I meant exactly this. No implicitness.

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

No branches or pull requests

2 participants