On May 15, 2010, at 7:53 AM, David Herman wrote:
I wonder if you considered having an export list, rather than
tagging the individual exports? I think that makes it easier to
see/document the public API of a module. You could at the same
time allow renaming on export.
Yes, this is a good point. We chose inline-export for convenience,
but I don't see any reason not to allow both.
+1 on an export form that takes a list of already-declared names.
FWIW, the rename on import looked "backwards" to me at first
glance, but I think I can learn.
Yeah, I'm not thrilled about how hard it is to remember which way it
goes. I meant for it to be consistent with the syntax of
destructuring:
let { draw: d } = obj;
import M.{ draw: d };
One has to grok destructuring, but once past that, this is the only
sane way. The shorthand applies.
http://wiki.ecmascript.org/doku.php?id=harmony:destructuring
Alternatively, we could a) disallow leaving off the '.{...}' for
importing a single binding and 'import x1.---.xn' would only be
allowed to specify a module-binding and would import all its
exports, or b) allow leaving off the '.{...}' but specify that it
imports just the single binding when it's a value-binding and
imports-all when the path indicates a module-binding. I am a little
concerned that the former is too restrictive and the latter too
subtle. IMO. the extra '.*' is only a two-character hardship and
EIBTI.
+1, or more -- agree on always requiring .{x} for lone x being too
restrictive, and the subtlety of .x meaning import-all sometimes,
import just x from left-context module other times, is even worse!
EIBTI FTW ;-)
/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss