Modules: Curly Free
allen at wirfs-brock.com
Tue Apr 16 11:17:47 PDT 2013
On Apr 16, 2013, at 10:54 AM, Kevin Smith wrote:
> OK, you asked for it. How exactly is that superior to
> export let it = f(1, 2, 3)
> import it as foo from "foo"
> which is both shorter and does not need any extension to the syntax at all?
> It is seen as a deficiency (anti-idiomatic?) by some members of the development community to have to rename the "one thing" at all. I remain on the fence about it. Maybe developer outreach would be more effective than syntax, in this case?
But in this case the "one thing" doesn't actually have a pre-existing name so nothing is being renamed.
Also, if the export keyword is currently always followed by a declaration keyword (let, const, class, function) there would seem to be a good chance that syntactically no second keyword could be interpreted as an implicit let (or const), so:
export foo = f(1, 2, 3); //means same thing as: export let foo = f(1,2,3)
I haven't actually analyzed the grammar implications, but it seems plausible.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss