-
Notifications
You must be signed in to change notification settings - Fork 3
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
Alternative syntax #10
Comments
Making it look more like a url will make people think it acts more like a url. In particular, it may be confusing that the following are not equivalent: import foo/src/bar
import ./foo/src/bar Also, the more identifier-based syntax makes further syntactic extensions more natural, such as #4. |
Interesting idea.
I think many people out there still use the name One reason I was pushing for @seaneagan - good point about the ambiguity, I'd also expect Putting aside my preferences for Here are some possible ideas:
import dart:async; // "dart:async"
import package:foo/src/bar; // package:foo/src/bar.dart
import package:foo/foo; // package:foo/foo.dart
import /foo/foo; // package:foo/foo.dart
import /foo; // package:foo/foo.dart
import /foo/src/bar; // package:foo/src/bar.dart
import src/bar; // relative path
import ./src/bar; // relative path, equivalent to src/bar
import dart:async; // "dart:async"
import package:foo/src/bar; // package:foo/src/bar.dart
import package:foo/foo; // package:foo/foo.dart
import :foo/foo; // package:foo/foo.dart
import :foo; // package:foo/foo.dart
import :foo/src/bar; // package:foo/src/bar.dart
import src/bar; // relative from here
import dart:async; // "dart:async"
import foo:src/bar; // package:foo/src/bar.dart
import foo:foo; // package:foo/foo.dart
import foo:; // package:foo/foo.dart
import src/bar; // relative from here
Interestingly, with this syntax we could use the absolute path import /src/bar; // would resolve to package:p1/src/bar.dart
import :src/bar; // yet another possible alternative syntax Thoughts? |
Also, another reason to pick the |
About using |
agree - that relates to sean question in #6, without a canonical way to discover "the current package", this might make no sense in the context of non-package uri'd libraries. |
Maybe it doesn't have to be all dots. How about:
I think slashes makes it more understandable than using "foo.src.bar" when "src" is really a directory and the library is just called "foo.bar".
The text was updated successfully, but these errors were encountered: