ah, right, I was thinking about `x = y`. In any case, the same applies, import 
and export declarations will not break the mental model for assignments, 
initializations, etc, the result for the original example will be `42` / 
`"orig"`.

/caridy

> On Mar 18, 2015, at 1:11 PM, Mark S. Miller <[email protected]> wrote:
> 
> I have not been following this thread, so my response may be out of context. 
> But I have to point out that
> 
>     let x = y;
> 
> is *not* an assignment. It is an initialization.
> 
> 
> 
> 
> On Wed, Mar 18, 2015 at 12:34 PM, caridy <[email protected] 
> <mailto:[email protected]>> wrote:
> Kyle, same answer, `let x = y` is just an assignment. btw, you cannot change 
> `y` in that module, that's a static error.
> 
> /caridy
> 
> > On Mar 18, 2015, at 12:26 PM, Kyle Simpson <[email protected] 
> > <mailto:[email protected]>> wrote:
> >
> >> we are NOT changing the semantic of the assignment expression.
> >
> > So the result is going to be `42` / `"orig"`, right? :)
> >
> > The reason I asked is not because I thought we were changing the semantic 
> > of the assignment expression, but because I wasn't sure if this top-level 
> > "const or whatever binding" was some sort of special thing that you can 
> > only hold a reference to. Clearly not.
> >
> > Also, since `y` keeps a reference to the "orig"inal function reference 
> > imported, even if the module updates itself, this very well may affect 
> > those who (in places other than this thread, and for different reasons) 
> > have often suggested they plan to do stuff like:
> >
> > ```js
> > import { y } from "..";
> >
> > let x = y;
> > ..
> > // use x now
> > ```
> >
> > In those cases, I was trying to find out if `x` could be updated by the 
> > module itself, like `y` can, because that matters (either good or bad) to 
> > the desire to use such a pattern. Since `x` can't get updated here, it's 
> > now clear to me that I wouldn't want to use such pattern, for fear that I 
> > am not using the latest API binding.
> >
> > Thanks for clarifications!
> > _______________________________________________
> > es-discuss mailing list
> > [email protected] <mailto:[email protected]>
> > https://mail.mozilla.org/listinfo/es-discuss 
> > <https://mail.mozilla.org/listinfo/es-discuss>
> 
> _______________________________________________
> es-discuss mailing list
> [email protected] <mailto:[email protected]>
> https://mail.mozilla.org/listinfo/es-discuss 
> <https://mail.mozilla.org/listinfo/es-discuss>
> 
> 
> 
> -- 
>     Cheers,
>     --MarkM

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to