-
Notifications
You must be signed in to change notification settings - Fork 23
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
syntax request: from std/[foo1,foo2] import nil
; from "." / [foo1,foo2] import bar1, bar2, bar3
#76
Comments
I don't like it. Not importing everything from a module is rarely used feature. I don't see the need to improve the syntax for it. |
I use it when I have a lot of imports in a module and I want to reduce likelihood of symbol clashes. from std/[foo1,foo2] import nil # I use only a few from these; I'll need to fully qualify them
import std/[foo3,foo4] # I use a lot of symbols from these |
I think deciding to use fully qualified imports is a matter of personal style rather than something that should be outright discouraged. I prefer to just use Why the Also I feel the need to restate here that this does instigate a grammar change, albeit a small one. I'm iffy on grammar changes at this point but for this I don't really think it's too much of a big deal. |
that RFC doesn't mandate using implementing this (proposal 1 in particular) is easy and makes nim's features more orthogonal |
This RFC is stale because it has been open for 1095 days with no activity. Contribute a fix or comment on the issue, or it will be closed in 7 days. |
proposal 1
accept this syntax:
proposal 2
furthermore, also accept this syntax
with meaning:
find each symbol bar1,bar2,bar3 somewhere in import list
The semantics are clear:
CT error if one of these symbols can't be found in import list
no error if a symbol is found in more than 1 module in import list (the usual overloading rules shall apply)
benefits
import std/[foo1,foo2]
The text was updated successfully, but these errors were encountered: