Export Default Sugarings

2013-12-05 Thread Kevin Smith
TLDR: We should consider deferring specialized syntax for exporting a default binding until after ES6. In the current draft, there are 3 ways to export a default binding: 1. Export a local binding with the name default: class Parser { ... } export { Parser as default }; 2. Use

Re: Export Default Sugarings

2013-12-05 Thread Axel Rauschmayer
Good observation. However, if I were to simplify, I’d only keep #3. #1 and #2 look more syntactically questionable to me (kind of abusing names as keywords/markers). Axel On 05 Dec 2013, at 15:18 , Kevin Smith zenpars...@gmail.com wrote: TLDR: We should consider deferring specialized syntax

Re: Export Default Sugarings

2013-12-05 Thread Kevin Smith
Good observation. However, if I were to simplify, I’d only keep #3. #1 and #2 look more syntactically questionable to me (kind of abusing names as keywords/markers). #1 is the base case because it is completely general. Any IdentifierName may appear in the as clause. export { x as

Re: Export Default Sugarings

2013-12-05 Thread Erik Arvidsson
#2 was removed at the hallway discussion of the face to face meeting. Do you still think we should remove #3? On Thu, Dec 5, 2013 at 10:48 AM, Kevin Smith zenpars...@gmail.com wrote: Good observation. However, if I were to simplify, I’d only keep #3. #1 and #2 look more syntactically

Re: Export Default Sugarings

2013-12-05 Thread Kevin Smith
#2 was removed at the hallway discussion of the face to face meeting. Do you still think we should remove #3? My only real issue with #3 is that it raises a footgun flag for me: export default function parse1JS(code) { // ... } parse1JS.foo = bar; // Surprise!

Re: Export Default Sugarings

2013-12-05 Thread Andreas Rossberg
On 5 December 2013 16:48, Kevin Smith zenpars...@gmail.com wrote: #1 is the base case because it is completely general. Any IdentifierName may appear in the as clause. export { x as delete, y as new, z as default }; // Perfectly fine! I certainly wouldn't mind this simplification either.

Re: Export Default Sugarings

2013-12-05 Thread Kevin Smith
Although the import side has this one extra syntactic special case for defaults: import x, {y as z, ...} from ... That seems really redundant. I assume mixing default import with others will be an extremely rare case, and when really needed, can easily be expressed as either import

Re: Export Default Sugarings

2013-12-05 Thread Erik Arvidsson
The `import crazy, {more as boo} from 'name'` needs to go away. https://bugs.ecmascript.org/show_bug.cgi?id=2287 It is also bad because the order there is fixed and you cannot interleave. On Thu, Dec 5, 2013 at 11:25 AM, Kevin Smith zenpars...@gmail.com wrote: Although the import side has

Re: [Json] Response to Statement from W3C TAG

2013-12-05 Thread Allen Wirfs-Brock
On Dec 4, 2013, at 11:39 PM, Carsten Bormann wrote: On 05 Dec 2013, at 06:08, Tim Bray tb...@textuality.com wrote: FWIW, I have never understood what the ECMAnauts mean by the word “semantics” in this context, so I have no idea whether I agree with this statement. As one of the

Aligning from() and map()

2013-12-05 Thread Niko Matsakis
The ES6 draft specifies that `map()`, when applied to a typed array, yields another instance of that same type. For converting between array types, the `from()` method is added: var f1 = new Float32Array(); ... var f2 = f1.map(x = x * 2); // Yields Float32Array var i1 =