On 15 May 2010, at 12:53, P T Withington wrote:
> On 2010-05-13, at 19:41, David Herman wrote:
>
>> I've updated the strawman proposals for static modules and dynamic module
>> loaders and would love to get feedback from the es-discuss community.
>>
>> * Static modules:
>>
>> http://wiki.ecmascript.org/doku.php?id=strawman:simple_modules
>> http://wiki.ecmascript.org/doku.php?id=strawman:simple_modules_examples
>
> Looks great!
>
> I wonder if you considered having an export list, rather than tagging the
> individual exports? I think that makes it easier to see/document the public
> API of a module. You could at the same time allow renaming on export.
>
> module Cowboy {
> export {draw: d, shoot: s};
> function d () { ... };
> function s () { d(); };
> }
>
> FWIW, the rename on import looked "backwards" to me at first glance, but I
> think I can learn.
>
> Do we really need to say `.*` for all? We couldn't just say `import Math`?
If you wan't the exported symbols from the Math module to be available as (for
example) just `pi` and not `Math.pi`, then yes, you need the `.*`. IIRC this is
very similar to how python and java behave w.r.t imports and I think its the
right way.
Thought looking at the syntax section it seems that `import Math;` isn't valid
and instead you do it as `module Math = Math`. Why not use import here as well?
My first instinct here is `module` is for defining a module and `import` is
importing it - instead `module` serves a dual function. Is there any reasoning
for this behaviour that I might have missed?
-ash
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss