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

Customizable module export #96

Open
agg23 opened this issue Jan 2, 2021 · 0 comments
Open

Customizable module export #96

agg23 opened this issue Jan 2, 2021 · 0 comments

Comments

@agg23
Copy link
Contributor

agg23 commented Jan 2, 2021

It would be nice if we could selectively export members of a given module. I think this would only have implications for the compiler itself, and any code should not care, as long as they're doing the right thing.

For example:

/// module1.mfk
export byte test = 1
/// module2.mfk
import module1

print(test)
/// module3.mfk
import module2

print(test)
^ Syntax error

This would also clean up naming collisions in some scenarios, as you can only have collisions if the values are exported, the modules imported, and they are named the same.

This does carry the side effect of Program not simply containing a flat list of the AST, as who imports what must be tracked and resolved.

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

No branches or pull requests

2 participants