ES6 modules (sorry...)
Matthew Robb
matthewwrobb at gmail.com
Mon Jun 16 11:27:05 PDT 2014
My argument is that you can keep everything the same as it is now but
change the syntax to not use curlies and avoid the confusing similarity to
destructuring. You could use `(a,b,c)` or `<a,b,c>` and it would all
continue working as it does but be less confusing.
- Matthew Robb
On Mon, Jun 16, 2014 at 11:24 AM, Mark Volkmann <r.mark.volkmann at gmail.com>
wrote:
> Yes! Don't make it look like destructuring and then say it's nothing like
> that.
>
> At this point I'd be happy to be able to only get back one thing from an
> import (no destructure-like syntax) that could be any kind of value,
> including an object with lots of methods on it like we are used to in
> Node.js. If I want the properties from such an object to be in variables, I
> can destructure that object in one more line of code.
>
>
> On Mon, Jun 16, 2014 at 12:39 PM, Matthew Robb <matthewwrobb at gmail.com>
> wrote:
>
>> I wonder if it would help reduce confusion if the syntax wasn't so
>> similar to destructuring:
>>
>> import ( foo, bar ) from "library";
>>
>> or
>>
>>> import < foo, bar > from "library";
>>
>>
>>
>> - Matthew Robb
>>
>>
>> On Mon, Jun 16, 2014 at 10:24 AM, Domenic Denicola <
>> domenic at domenicdenicola.com> wrote:
>>
>>> I'm not talking about MIO properties. I'm talking about the bindings
>>> created by import declarations.
>>> ------------------------------
>>> From: Sam Tobin-Hochstadt <samth at cs.indiana.edu>
>>> Sent: 2014-06-16 13:21
>>> To: Domenic Denicola <domenic at domenicdenicola.com>
>>> Cc: Calvin Metcalf <calvin.metcalf at gmail.com>; es-discuss Steen
>>> <es-discuss at mozilla.org>; C. Scott Ananian <ecmascript at cscott.net>
>>> Subject: RE: ES6 modules (sorry...)
>>>
>>>
>>> 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
>>>
>>> _______________________________________________
>>> es-discuss mailing list
>>> es-discuss at mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140616/56052440/attachment-0001.html>
More information about the es-discuss
mailing list