Module syntax

Jeff Morrison lbljeffmo at gmail.com
Mon Jun 3 20:02:31 PDT 2013


`import foo from "foo";` reads to the quick eye as "import the symbol 
named foo from the module named 'foo'" -- but that's not actually what 
it means (wrapped curlies be damned!).
I think the syntax would read much less confusingly if we made use of a 
`default` keyword to signify better what's happening in this declaration...

Anything from `import default foo from "foo"` to the more preferable (in 
my mind) `import default as foo from "foo"`

On 6/3/13 7:07 PM, Kevin Smith wrote:
>
>
>     > Bikeshedding:
>
>     Well, here comes a fun thread...
>
>
> Bikeshedding *is* fun : )
>
> FWIW, I've implemented a parser for curly-free syntax and it does 
> introduce some minor parsing difficulties on the export side.  If we 
> had lexical modules, then this:
>
>     export module as ...
>
> could be a valid prefix for an exported module declaration or an 
> export set.  You basically need more tokens of lookahead to 
> disambiguate on these contextual keywords.
>
> I'm totally happy with the current syntax, modulo some concern over 
> the default export syntax which I mentioned upthread.
>
> { Kevin }
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130603/2d110891/attachment.html>


More information about the es-discuss mailing list