Two kinds of [] (was: Re: shortcuts for defining block-local private names, plays nicely with @foo syntax)

Brendan Eich brendan at mozilla.org
Fri Jan 27 16:10:29 PST 2012


> Tom Van Cutsem <mailto:tomvc.be at gmail.com>
> January 27, 2012 10:53 AM
>
>     Off-topic: What is the recommended style for naming modules?
>     Capitalized and camel-cased? It’s nothing I couldn’t get used to,
>     but it seems like the naming precedent would be JavaScript
>     packages. Or is Reflect capitalized, because it is a built-in module?
>
>
> I have been using @reflect as the name of the module, and Reflect as 
> the name of the module instance object, as in:
>
> module Reflect from "@reflect";

I believe that the latest (not yet in wiki) syntax uses 'at' not 'from' 
for the out-of-line module body case:

   module M { ... }
   module N at "U";
   import P from M;
   import P from "U";

P is a pattern, in general. It could be * or an identifier if not a full 
destructuring pattern.

/be
>
> Not sure if that is still the correct module syntax (and naming 
> convention).
>
> Cheers,
> Tom
>


More information about the es-discuss mailing list