That’s a good solution. Logically, `import { * } from "fs"` may make more
sense, but I prefer the “unbraced” asterisk, because it results in less clutter.
Does the proposed syntax clash with `export * FromClause` (which, I’m assuming,
re-exports everything, not just the named exports)?
I’d prefer it if named exports and a default export were mutually exclusive,
but I understand that is off the table(?) Which is also fine with me…
Axel
On Jun 19, 2014, at 10:15 , David Herman <[email protected]> wrote:
> ## Proposal
>
> OK, so we're talking about a better syntax for importing a module and binding
> its named exports to a variable (as distinct from importing a module and
> binding its default export to a variable). Here's my proposal:
> ```js
> import * as fs from "fs"; // importing the named exports as an object
> import Dict from "dict"; // importing a default export, same as ever
> ```
--
Dr. Axel Rauschmayer
[email protected]
rauschma.de
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss