Re: ModuleImport

2014-06-26 Thread Kevin Smith
On Wed, Jun 25, 2014 at 4:50 PM, C. Scott Ananian ecmascr...@cscott.net wrote: @John Barton: Yes, ideally that syntax would work as well when you don't need a namespace. But sometimes you do need a namespace, even if you don't care precisely what it is: ``` import {format} from 'url';

Re: TC39 vs the community

2014-06-26 Thread Garrett Smith
Nice. I wonder what Horse would think of Vermin Supreme's pony identification program. But in all seriousness, Google, MSFT, are all pushing for IoT or wearables by putting on events featuring that, creating a buzz, and making press on the event. On 6/23/14, Brendan Eich bren...@mozilla.org

The specification license issue

2014-06-26 Thread musicdenotation
Has the ECMAScript specification license problem been resolved? If so, how? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: ModuleImport

2014-06-26 Thread Marius Gundersen
On Thu, Jun 26, 2014 at 8:15 AM, Kevin Smith zenpars...@gmail.com wrote: I agree, and importing as a namespace is what ModuleImport is all about. Crazy idea: what if we had this: // ModuleImport: import Identifier from StringLiteral import fs from fs; import url from url;

Default exports, without explicit syntactic support

2014-06-26 Thread Axel Rauschmayer
(I’m happy with David’s proposal, but I’d like to try bikeshedding one more time.) Building on an idea by Kevin Smith: how about supporting default exports without any explicit syntactic constructs? The convention would be: the name `_` is used for default exports. The following is a

Re: ModuleImport

2014-06-26 Thread Kevin Smith
Now the author can choose to export more things later without making breaking changes to the module. The only downside to this is the (apparently mandatory) curly braces around the imported object. If single export/import becomes the convention with ES6 modules then users will be forced to

Re: Default exports, without explicit syntactic support

2014-06-26 Thread Kevin Smith
(I’m happy with David’s proposal, but I’d like to try bikeshedding one more time.) For my part, I no longer think that the import * as foo change solves anything. The underlying problem is default exports - it's just plain confusing to users. // main.js import { _ as MyClass } from

Re: Default exports, without explicit syntactic support

2014-06-26 Thread Marius Gundersen
On Thu, Jun 26, 2014 at 3:39 PM, Kevin Smith zenpars...@gmail.com wrote: The underlying problem is default exports - it's just plain confusing to users. I agree What do you think? Is there any user experience issue here that needs to be sugared over? Notice that, on the import side,

Re: Default exports, without explicit syntactic support

2014-06-26 Thread Calvin Metcalf
the slight difference in `import { MyClass } from my-class.js;` compared to `var MyClass = require(./my-class.js);` is that in cjs MyClass is a variable the user create, meaning the user only need to know about 1 name from the remote module, the path, but in ES6 MyClass is set by the exporter

Re: The specification license issue

2014-06-26 Thread Allen Wirfs-Brock
On Jun 25, 2014, at 11:48 PM, musicdenotat...@gmail.com wrote: Has the ECMAScript specification license problem been resolved? If so, how? see http://www.ecma-international.org/memento/Ecma%20copyright%20FAQ.htm ___ es-discuss mailing list

Re: Default exports, without explicit syntactic support

2014-06-26 Thread Kevin Smith
On Thu, Jun 26, 2014 at 9:56 AM, Calvin Metcalf calvin.metc...@gmail.com wrote: the slight difference in `import { MyClass } from my-class.js;` compared to `var MyClass = require(./my-class.js);` is that in cjs MyClass is a variable the user create, meaning the user only need to know about 1

Re: Default exports, without explicit syntactic support

2014-06-26 Thread Kevin Smith
First - I reject the idea that making the export anonymous is in any way good practice. Frankly, naming things is essential to API design. Here's a concrete example of why you should always name your exports: // A.js export class A {} // B.js export class B {} //

Re: Default exports, without explicit syntactic support

2014-06-26 Thread Kevin Smith
If you rely on anonymous exports, you're going to be SOL when trying to aggregate like this. Sorry, meant to add that I aggregate like this *all* the time. ___ es-discuss mailing list es-discuss@mozilla.org

Re: Default exports, without explicit syntactic support

2014-06-26 Thread Axel Rauschmayer
// my-class.js export class MyClass { constructor() { ... } method() { ... } } // use-class.js import { MyClass } from my-class.js; You do have redundancy in `my-class.js` and, as Marius pointed out, the importer has to know both the name of the

Re: Default exports, without explicit syntactic support

2014-06-26 Thread John Barton
On Thu, Jun 26, 2014 at 7:39 AM, Axel Rauschmayer a...@rauschma.de wrote: // my-class.js export class MyClass { constructor() { ... } method() { ... } } // use-class.js import { MyClass } from my-class.js; You do have redundancy in `my-class.js` and,

Re: ModuleImport

2014-06-26 Thread Russell Leggett
Now the author can choose to export more things later without making breaking changes to the module. The only downside to this is the (apparently mandatory) curly braces around the imported object. If single export/import becomes the convention with ES6 modules then users will be forced to

Re: ModuleImport

2014-06-26 Thread C. Scott Ananian
On Thu, Jun 26, 2014 at 10:50 AM, Russell Leggett russell.legg...@gmail.com wrote: To me, though, that goes back to the destructuring/not destructuring aspect. Maybe this has floated by during the bikeshedding, but why not something like: //import a single named export import foo

Re: Default exports, without explicit syntactic support

2014-06-26 Thread C. Scott Ananian
On Thu, Jun 26, 2014 at 9:39 AM, Kevin Smith zenpars...@gmail.com wrote: (I’m happy with David’s proposal, but I’d like to try bikeshedding one more time.) For my part, I no longer think that the import * as foo change solves anything. The underlying problem is default exports - it's just

Re: ModuleImport

2014-06-26 Thread Mark Volkmann
On Thu, Jun 26, 2014 at 9:50 AM, Russell Leggett russell.legg...@gmail.com wrote: To me, though, that goes back to the destructuring/not destructuring aspect. Maybe this has floated by during the bikeshedding, but why not something like: //import a single named export import foo

Re: ModuleImport

2014-06-26 Thread Russell Leggett
I like the fact that this doesn't look like destructuring, since variable binding is different from destructuring assignment. Could ``` import foo, baz from bar as bar; ``` allowed simultanous import of named exports and the module itself? If so, the grammar gains a pleasing regularity.

Issue when subclassing a bound function used as constructor

2014-06-26 Thread Claude Pache
let C be some constructor let D = C.bind(obj, a, b) Thanks to the carefully designed `D.[[Construct]]` internal method, the following expressions are equivalent: new D(...args) new C(a, b, ...args) Consider now: class E extends D { contructor(...args) {

Re: Issue when subclassing a bound function used as constructor

2014-06-26 Thread Allen Wirfs-Brock
Hmm On Jun 26, 2014, at 9:57 AM, Claude Pache wrote: let C be some constructor let D = C.bind(obj, a, b) Thanks to the carefully designed `D.[[Construct]]` internal method, the following expressions are equivalent: Hmmand showing that perhaps is isn't so easy to get rid

Re: TC39 vs the community

2014-06-26 Thread Jasper St. Pierre
On Thu, Jun 26, 2014 at 2:41 AM, Garrett Smith dhtmlkitc...@gmail.com wrote: Nice. I wonder what Horse would think of Vermin Supreme's pony identification program. But in all seriousness, Google, MSFT, are all pushing for IoT or wearables by putting on events featuring that, creating a

Re: ModuleImport

2014-06-26 Thread Kevin Smith
To me, though, that goes back to the destructuring/not destructuring aspect. Maybe this has floated by during the bikeshedding, but why not something like: //import a single named export import foo from bar; //import multiple named exports import foo, baz from bar;