-
-
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
Could using X as Y
be syntactic sugar for using X; const global Y = X
#38521
Comments
@JeffBezanson (since you authored #37396) and @fredrikekre (since you wrote Any thoughts? |
using X as Y
expand to using X; const Y = X
using X as Y
expand to using X; const global Y = X
This is basically what ImportMacros.jl does right now when you do this: using ImportMacros
@using DataFrames as df But since the ImportMacros.jl package has been deprecated, I figured it'd be nice to have this syntactic sugar in Julia. |
using X as Y
expand to using X; const global Y = X
using X as Y
be syntactic sugar for using X; const global Y = X
If you need a qualifier ( |
See also #1255 |
This was discussed and decided against in #37396, no? #37396 (comment) and the two following comments. |
The meaning that would seems to make sense for |
Yeah, that's exactly what I had in mind. |
This was the first thing i tried when i read about the Is there some other behaviour that could have been expected such that |
For this to be really useful It can't literally be syntactic sugar for Instead it needs to never bring the module's actual name into scope; and create a new name for it
|
The syntax
using X as Y
currently throws a syntax error:Would it be possible for
using DataFrames as df
to be syntactic sugar for this:The text was updated successfully, but these errors were encountered: