simpler, sweeter syntax for modules

David Herman dherman at mozilla.com
Wed Mar 21 17:38:38 PDT 2012


On Mar 21, 2012, at 4:25 PM, Kris Kowal wrote:

> On Wed, Mar 21, 2012 at 4:05 PM, Axel Rauschmayer <axel at rauschma.de> wrote:
>> Honest question: Are nested modules really needed?
> 
> There is a chance that they would be useful for bundling. Modules
> can’t be concatenated.

Yeah, I believe that's the strongest argument for nested modules.

It's also really nice for simple, lightweight grouping of components of a library.

Another issue if you can't nest modules would be restricting what it means to bind a module that you load from elsewhere inside another module, since in some sense that's a nested module. Maybe you just say you can't export those, or maybe they're only exportable as values.

But anyway, nesting modules is just more flexible and expressive. And yeah, the bundling point is probably the most important in practice.

Dave



More information about the es-discuss mailing list