Sam Tobin-Hochstadt (2014-06-16T17:21:08.000Z)
On Jun 16, 2014 1:06 PM, "Domenic Denicola" <domenic at domenicdenicola.com>
wrote:
>
> From: es-discuss <es-discuss-bounces at mozilla.org> on behalf of C. Scott
Ananian <ecmascript at cscott.net>
>
> > Using destructuring syntax for imports would be a *good thing*.  It
builds on our existing understanding of JS constructs, instead of adding
more gratuitously different things to learn.
>
> This would be a very *bad thing*, as long as the current model---where
exports are something wildly different from properties of an object, but
instead are cross-file `with`-esque read-only-but-mutable bindings---was
maintained. It's extremely important that these bindings look and are
manipulated as differently as possible from normal declarations and
destructuring of object properties.

In fact, module instance object properties behave nothing like with, and
are just like an object with a getter but no setter. Just as with any other
getter, they don't always return the same answer, but that doesn't make
them anything like with.

Perhaps you think JS should get rid of setters and getters, if you think
they're like with, but you should just say that if so.

Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140616/d51e5045/attachment-0001.html>
dignifiedquire at gmail.com (2014-06-17T18:21:55.512Z)
> On Jun 16, 2014 1:06 PM, "Domenic Denicola" <domenic at domenicdenicola.com> wrote:
>
>> From: es-discuss <es-discuss-bounces at mozilla.org> on behalf of C. Scott Ananian <ecmascript at cscott.net>
>>
>> Using destructuring syntax for imports would be a *good thing*.  It builds on our existing understanding of JS constructs, instead of adding more gratuitously different things to learn.
>
> This would be a very *bad thing*, as long as the current model---where exports are something wildly different from properties of an object, but instead are cross-file `with`-esque read-only-but-mutable bindings --- was maintained. It's extremely important that these bindings look and are manipulated as differently as possible from normal declarations and destructuring of object properties.

In fact, module instance object properties behave nothing like with, and are just like an object with a getter but no setter. Just as with any other getter, they don't always return the same answer, but that doesn't make them anything like with.

Perhaps you think JS should get rid of setters and getters, if you think they're like with, but you should just say that if so.