On Wed, Mar 21, 2012 at 11:33 PM, Brendan Eich <[email protected]> wrote:
> David Herman wrote:
>>
>> On Mar 21, 2012, at 9:28 PM, John J Barton wrote:
>>
>>> equals makes sense when it is assigment:
>>>
>>> module Bar = load("bar.js");
>>
>>
>> It's not an assignment, though. Which is why Brendan didn't like it in the
>> first place, since he felt programmers would get confused that it was a
>> dynamic assignment expression statement.
>>
>> OTOH, this confusion can't exactly last long, when the parser won't even
>> parse your program. I'm not sure that confusion is really worth worrying
>> about.
>
>
> But why make misleading syntax? More of a question for John: why write
> |load("bar.js")| there, looking for all the world like a function call
> evaluated in order at runtime, when this is a special form evaluated before
> runtime?
I guess you mean: a special form evaluated before the outer function
runs? Surely this form is not off-line.
What kinds of mistakes would I make? Seem to me the code has to work
as if there was a function call. The only 'special' thing is that the
compiler may decide to fetch and compile bar.js before the function
containing the module statement.
One thing I could not determine from the strawman is what happens in this case:
if (version === 1) {
import "foo1.js" as Foo;
} else {
import 'foo2.js' as Foo;
}
Assume that compiling fooN in the wrong environment fails badly.
jjb
>
> /be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss