-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: make __xxx__ names officially reserved #18249
Comments
Seems unnecessary and possibly counter-productive. Did we actually hit any conflicts when we introduced |
Grepping for this, I see a number of such identifiers used in packages: (No one is currently using |
Ref #11098 I also think we shouldn't use module level special names as long as it's possible so that it is easy to make use of those features in macros/libraries or moving code between modules. It might not be too meaningful to allow multiple entry points but I think a interface like |
Does it suffice to reserve |
@eschnett, I'm not sure what purpose |
@Stefan I have largely expected |
No, the name |
Seems like we don't need this (unlike Python, Julia doesn't have a global method namespace). |
We've used the name
__init__
as a function name with special meaning in modules (function that is automatically called after a module is loaded but before the module is precompiled) and we may introduce__main__
in the future as a function inMain
that is automatically called if it exists when a script run asjulia script.jl
finishes – the purpose being to allow a hypotheticaljulia-compile script.jl
to produce a binary that behaves in the same manner as if you'd runjulia script.jl
without any changes toscript.jl
. In general, this points to the notion that we should officially reserve names of the form__xxx__
as having special meaning to the system.The text was updated successfully, but these errors were encountered: