-
Notifications
You must be signed in to change notification settings - Fork 10
Implicit module name duplication #7
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
Comments
If we are doing to enable easy module duplicate, maybe also include a |
No, as the user should be allowed to decide for themselves whether the outer scopes imports should be available for each module. This will therefore force a specific usage pattern on users. |
Using hygiene to reuse the module name may not be appropriate everywhere. F.eks. if tests are duplicated this way, there is no way to know which module failed, as they would all have the same name (to the user.)
Could expand to:
Here notice that the |
When enabled, if duplicate is put on a module, but that module's name is not substituted, will automatically substitute the module's name by using a suitable substitution identifier. See #7.
When enabled, if duplicate is put on a module, but that module's name is not substituted, will automatically substitute the module's name by using a suitable substitution identifier. See #7.
Implemented and released in v0.2.6. |
Since procedural macros will soon support hygiene, it would be appropriate to implement implicit module name duplication.
if
duplicate
is applied to a module, the user is currently required to make sure that the module has a unique name for every duplicate. This is tedious and must be done every time. To improve the user experience,duplicate
could use hygiene to allow all duplicates to keep the same module name, but with different hygiene. This means the user no longer has to manually assign names to each module duplicate.The rule could be that if
duplicate
is applied to a module directly, hygienic renaming will kick in, however, if the module is already renamed by a substitution identifier, the hygienic renaming won't happen. This should therefore be a non-breaking change.The text was updated successfully, but these errors were encountered: