On 2010-05-15, at 11:22, Brendan Eich wrote:
>> On May 15, 2010, at 7:53 AM, David Herman wrote:
[...]
>>> 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.
Ah, destructing `.`, I missed that. Perhaps I would have gotten it with a
closer parallel like
let { draw: d } = import M;
or
import { draw: d } from M;
>> 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 ;-)
I guess `.*` is there for a purpose: to remind me that it's very likely I
don't want to say that. :)
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss