Re: Rationale for dropping ModuleImport syntax?

2014-06-09 Thread Axel Rauschmayer
rt didn’t look like “the module”, things would, in my opinion, be easier to understand: ```js import _ from "Underscore"; import { flatten, union } from "Underscore"; import default someFunction from "single_function_module"; ```

Re: Rationale for dropping ModuleImport syntax?

2014-06-09 Thread Axel Rauschmayer
to me and you don’t get load-time errors, either: ```js import "Underscore"; const _ = System.get("Underscore"); ``` [^1]: https://gist.github.com/domenic/2230a7195fa0de31a227 On Jun 9, 2014, at 16:28 , John Barton wrote: > > > > On Mon, Jun 9, 2014 at 6:54 A

Re: Rationale for dropping ModuleImport syntax?

2014-06-09 Thread Axel Rauschmayer
removed. > jjb > > > On Mon, Jun 9, 2014 at 6:39 AM, Axel Rauschmayer wrote: >>> Isn't the problem, though, that default-exporting an object prevents static >>> checking? It feels like an abuse of this feature to me. >> >> We don't have sta

Re: `this` inside modules

2014-06-09 Thread Axel Rauschmayer
that `this` is not really the module, it is an object that > contains, among other things, a reference to another object with the live > binding, a relative import, a relative get, etc. Give it a different name, then. Call it `moduleDescriptor`, `moduleData`, etc. -- Dr. Axel Rauschmay

Re: Rationale for dropping ModuleImport syntax?

2014-06-09 Thread Axel Rauschmayer
ing at top-level and string-only, and automatically introduce `"use > strict"` for you.) I agree. I also love tools such as the es6-module-transpiler, which allow us to move beyond the AMD/CJS schism right now. -- Dr. Axel Rauschmayer a...@rauschma.de rauschma.de

Re: Rationale for dropping ModuleImport syntax?

2014-06-09 Thread Axel Rauschmayer
and > unbraced single-import will remain in the “good parts” bin, giving us the > same CommonJS/AMD world we have today, but with some vestigial syntax unused > by popular libraries. > > From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Axel > Rauschmayer

Rationale for dropping ModuleImport syntax?

2014-06-08 Thread Axel Rauschmayer
ts are involved. I also don’t see how CommonJS-style modules could be neatly migrated to ES6 modules if this feature was dropped. I do agree that the ModuleImport reads a bit strange, but that could be fixed, e.g. via a suggestion I’ve seen somewhere: ```js import module foo from "foo

Re: `this` inside modules

2014-06-08 Thread Axel Rauschmayer
eta > capabilities, giving it a name like `module` or `System.currentModule` would > be much better. > > [1]: > http://people.mozilla.org/~jorendorff/es6-draft.html#sec-execution-contexts > ___ > es-discuss mailing list > es-discuss@mozilla.

Publication date of ES7?

2014-06-06 Thread Axel Rauschmayer
Sorry, I tried finding it (e.g. on [1] and the mailing list), but couldn’t: when is the currently planned publication date of ECMAScript 7? Thanks! Axel [1] https://github.com/tc39/ecma262 -- Dr. Axel Rauschmayer a...@rauschma.de rauschma.de

Re: My ECMAScript 7 wishlist

2014-06-05 Thread Axel Rauschmayer
prefer a different name such as “noop” or “doNothing”; “empty” doesn’t feel right in the context of something executable. Also, I don’t find using an empty arrow function too bad (to me, it looks quite intention-revealing): ```js someAsyncMethod(() => {}); ``` -- Dr. Axel Rauschmayer a...

Idea for ECMAScript 7: Number.compare(a, b)

2014-06-05 Thread Axel Rauschmayer
It’d be nice to have a built-in way for comparing numbers, e.g. when sorting arrays. ```js // Compact ECMAScript 6 solution // Risk: number overflow [1, 5, 3, 12, 2].sort((a,b) => a-b) // Proposed new function: [1, 5, 3, 12, 2].sort(Number.compare) ``` -- Dr. Axel Rauschmayer a...@rauschma

Re: The Existential Operator

2014-05-22 Thread Axel Rauschmayer
`null`. AFAICT that’s also how CoffeeScript’s existential operator works. I’m ambivalent about it, though: it would be useful, but would also add complexity to the language. -- Dr. Axel Rauschmayer a...@rauschma.de rauschma.de ___ es-discuss mailing li

Re: Bytecode

2014-05-14 Thread Axel Rauschmayer
It'd be great if there was material on the limits of the JVM and the CLR. AFAICT these are the only virtual machines that are trying to be universal (run both static and dynamic languages well). [[[Sent from a mobile device. Please forgive brevity and typos.]]] Dr. Axel Rauschma

Bytecode

2014-05-14 Thread Axel Rauschmayer
! Axel -- Dr. Axel Rauschmayer a...@rauschma.de rauschma.de Check out my new book: SpeakingJS.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Perhaps @@unscopable shouldn't be a Set...

2014-04-30 Thread Axel Rauschmayer
On 30 Apr 2014, at 21:17 , Boris Zbarsky wrote: > On 4/30/14, 2:49 PM, Axel Rauschmayer wrote: >> So Element.prototype is in the variable scope chain of event handlers? Wow. >> Is this documented somewhere? > > You mean other than in the spec? See > http://www.w

Re: Perhaps @@unscopable shouldn't be a Set...

2014-04-30 Thread Axel Rauschmayer
somewhere? Thanks! Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Perhaps @@unscopable shouldn't be a Set...

2014-04-30 Thread Axel Rauschmayer
e perfect, but unfortunately won’t work. Somehow, we have to put the burden on `with` and the legacy code instead of the future-facing parts of the language. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2

Re: setPrototypeOf vs obj.__proto__ assignment

2014-04-07 Thread Axel Rauschmayer
here for legacy compatibility. >> setPrototypeOf should be preferred for new code > > For new code, neither should be used. > > /Andreas > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listi

Re: [[Set]] and inherited readonly data properties

2014-04-01 Thread Axel Rauschmayer
m to find it in Caja. Thanks! Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Template strings and templates

2014-03-06 Thread Axel Rauschmayer
version could be used as a key to look up the international version. You could also reorder the pieces. A bit of work for a library, but template strings would help, a little. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com _

Re: Template strings and templates

2014-03-06 Thread Axel Rauschmayer
't be included in harmony, i'm just very > interested in finding out what practical task they are meant to accomplish > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss --

Re: Standard modules?

2014-01-19 Thread Axel Rauschmayer
(the page's last edit). For instance, Proxy now lives in a >> separate @reflect module. >> >> Regards, >> Tom >> >> >> 2014/1/19 Axel Rauschmayer >> http://wiki.ecmascript.org/doku.php?id=harmony:modules_standard >> >> Is t

Standard modules?

2014-01-19 Thread Axel Rauschmayer
http://wiki.ecmascript.org/doku.php?id=harmony:modules_standard Is this the most current document on the standard modules? Thanks! Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Capitalization: symbol vs. Symbol

2014-01-17 Thread Axel Rauschmayer
blic, not private - ok that they leak to Proxy > * Symbols are unique > * Only exposed via Object.getOwnPropertySymbols instead of > Object.getOwnPropertyKeys > * |Object.mixin| copies both symbol and string properties -- Dr. Axel Rauschmayer a

Capitalization: symbol vs. Symbol

2014-01-17 Thread Axel Rauschmayer
Given that all upcoming value object constructors will start with lowercase letters, shouldn’t Symbol, too? Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list

Re: Enumerability

2014-01-13 Thread Axel Rauschmayer
* own properties. > > http://esdiscuss.org/topic/enumerability#content-2 -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Value objects: roll your own?

2014-01-12 Thread Axel Rauschmayer
lass, it belongs to both. Hence, I’d use something more like a (global) function declaration: ``` function number + point2d (a, b) { return point2d(a + b.x, a + b.y); } ``` Or, possibly: ``` function + (a :: number, b :: point2d) { return point2d(a + b.x, a + b.y); }

Value objects: roll your own?

2014-01-11 Thread Axel Rauschmayer
http://www.slideshare.net/BrendanEich/value-objects One thing is not entirely clear from the slides: Will developers be able to define their own value object types? Without that feature I don’t see how overloading operators would be very interesting. Thanks! Axel -- Dr. Axel Rauschmayer a

Re: Enumerability

2014-01-11 Thread Axel Rauschmayer
or-in style, right? That is, inherited and own non-enumerable properties. We’ll deviate from that anyway. Independently of what enumerability means, I can only think of cases (including Claude Pache’s pro-enumerability example) where I would want to copy *all* own properties. Axel -- Dr.

Re: Enumerability

2014-01-11 Thread Axel Rauschmayer
to > be improved. Just to be clear: this one is not (necessarily) on you, you have your work cut out for you, anyway. I’m thinking more along the lines along a companion document. But NOTEs are a great idea, I’ll keep it in mind while reading the spec. Axel -- Dr. Axel Rauschmayer a...@rau

Re: Enumerability

2014-01-11 Thread Axel Rauschmayer
ncredibly important for making sense of what’s going on: The answers and discussions on this mailing list were essential in helping me understand the language. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___

Re: Enumerability

2014-01-11 Thread Axel Rauschmayer
> * I can happily serialise my tree using `JSON.stringify`, and it won't > complain that it can't handle cyclic structures. After deserialising it with > `JSON.parse`, I just have to recursively reconstruct the `_parent` > back-references; > * etc. Nice example. D

Re: Enumerability

2014-01-10 Thread Axel Rauschmayer
looking for a simple explanation of what enumerability will be, going forward. If there isn’t one then I’d argue that no new feature should be influenced by it. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com __

Enumerability

2014-01-09 Thread Axel Rauschmayer
design of ECMAScript going forward if we had a definitive and complete explanation of what enumerability is now and what it should be in the future. I’m trying to make sense of it and to explain it to others and continue to fail. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de

Re: Object.is()

2013-12-22 Thread Axel Rauschmayer
be more useful if it didn’t distinguish +0 and -0? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

getOwnPropertySymbols + getOwnPropertyNames

2013-12-22 Thread Axel Rauschmayer
-- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Object.is()

2013-12-21 Thread Axel Rauschmayer
()`? Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Symbol.keyFor

2013-12-21 Thread Axel Rauschmayer
Offhand, ID instead of key, but that is awfully generic. It may make sense to invent a new term. On Dec 22, 2013, at 6:53 , Mark S. Miller wrote: > Suggestions? > > > On Sat, Dec 21, 2013 at 9:48 PM, Axel Rauschmayer wrote: > One problem with that method name: it overload

Symbol.keyFor

2013-12-21 Thread Axel Rauschmayer
One problem with that method name: it overloads the term “key”. At the moment, property keys are either strings or symbols. If a symbol can also have a key, I’d find that confusing. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: const VS features detection

2013-12-20 Thread Axel Rauschmayer
t; https://mail.mozilla.org/listinfo/es-discuss > -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: “Arrow is not a replacement for all functions that want lexical this”

2013-12-09 Thread Axel Rauschmayer
as surprised to find out that the majority of people prefer var + function expression to a function declaration, because then there is only a single kind of function definition. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Specifics of `class` and `super`

2013-12-09 Thread Axel Rauschmayer
ode I could compile to for roughly the same semantics, that > would be helpful. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://ma

Re: Export Default Sugarings

2013-12-05 Thread Axel Rauschmayer
les to guide syntax additions. > > > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: if-scoped let

2013-12-04 Thread Axel Rauschmayer
is kind of in-statement declaration only be used for truthy/falsy tests? In loops (for-of, while), I find this kind of thing useful, for if-then-else, much less so. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com _

Re: Async functions?

2013-11-28 Thread Axel Rauschmayer
Thanks! But I don’t see `function!`, anywhere. On Nov 28, 2013, at 16:10 , Mark S. Miller wrote: > http://wiki.ecmascript.org/doku.php?id=strawman:async_functions > > cheers, MarkM > > On Nov 28, 2013 12:34 AM, "Axel Rauschmayer" wrote: > In the most recent mee

Async functions?

2013-11-28 Thread Axel Rauschmayer
#410-generator-arrow-function-syntax Thanks! Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

“Arrow is not a replacement for all functions that want lexical this”

2013-11-28 Thread Axel Rauschmayer
Source: David Herman, https://github.com/rwaldron/tc39-notes/blob/master/es6/2013-11/nov-20.md Can someone elaborate? I don’t see an alternative. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Generator Arrow Functions

2013-11-27 Thread Axel Rauschmayer
g notes, too? Thanks! Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: PutValue – correctly implemented by engines?

2013-11-23 Thread Axel Rauschmayer
Can you tell me where to do that? Or is test262 a better way to fix this (assuming that it is run regularly on V8 and SpiderMonkey)? On Nov 23, 2013, at 17:15 , Mark S. Miller wrote: > Hi Axel, please file bugs against Firefox and V8. > > > On Sat, Nov 23, 2013 at 2:24 AM, Axel

Re: PutValue – correctly implemented by engines?

2013-11-23 Thread Axel Rauschmayer
It does indeed. I just checked in Safari and got an exception. Thanks, Axel On Nov 23, 2013, at 11:00 , Yusuke SUZUKI wrote: > JavaScriptCore implements it correctly. > > --- > Regards, > Yusuke Suzuki > > > On Sat, Nov 23, 2013 at 6:24 PM, Axel Rauschmayer wrote:

PutValue – correctly implemented by engines?

2013-11-23 Thread Axel Rauschmayer
mode). ```js (function () { 'use strict'; var s=''; s.foo=3 }()); ``` But it doesn’t (not on Firefox and V8). [1] http://ecma-international.org/ecma-262/5.1/#sec-8.7.2 -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rausc

Re: ES 5.1 – 9.10 CheckObjectCoercible

2013-11-22 Thread Axel Rauschmayer
Well, strike that. I misunderstood what the operation does. Sorry. On Nov 22, 2013, at 21:36 , Axel Rauschmayer wrote: > Not sure it matters, but: table 15 is incomplete. Four trues are missing. > > -- > Dr. Axel Rauschmayer > a...@rauschma.de > > home: rauschma.de &

ES 5.1 – 9.10 CheckObjectCoercible

2013-11-22 Thread Axel Rauschmayer
Not sure it matters, but: table 15 is incomplete. Four trues are missing. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Links in the ES5.1 PDF?

2013-11-20 Thread Axel Rauschmayer
In the ES5 spec PDF, there were convenient links from the ToC to the content. In the ES5.1 spec, they are gone. Is there a way to bring them back? Thanks! Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Generator Arrow Functions

2013-11-20 Thread Axel Rauschmayer
> functions making "function" a legacy My hope, too. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Modules vs Scripts

2013-11-17 Thread Axel Rauschmayer
>> Is the value of `src` a module ID or a path? How about when packages are >> used (for bundling)? Is there a way to combine module IDs and packages? > > For the most part the answer to these kinds of questions is that we support > "all of the above," but I'd like to wait just a little bit long

Re: Modules vs Scripts

2013-11-17 Thread Axel Rauschmayer
On Nov 17, 2013, at 6:14 , David Herman wrote: >> Does this imply ? > > Works either way, inline or external. (Requiring src="" is one of the reasons > why

Re: Generator Arrow Functions

2013-11-16 Thread Axel Rauschmayer
Caveat: with yield*, you want generators to be more like functions than like blocks. [[[Sent from a mobile device. Please forgive brevity and typos.]]] Dr. Axel Rauschmayer a...@rauschma.de Home: http://rauschma.de Blog: http://2ality.com On 16.11.2013, at 10:28, "Claus Reinke&qu

Re: Generator Arrow Functions

2013-11-15 Thread Axel Rauschmayer
's original examples. Ah, missed that. Thought it was *=>. I don’t mind either way, my (admittedly weak) mnemonic would be “asterisk after function-defining token”. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com _

Re: Generator Arrow Functions

2013-11-15 Thread Axel Rauschmayer
.html('Download complete.'); yield status.fadeIn().promise(); yield sleep(2000); status.fadeOut(); }); ``` [Example taken from task.js website.] -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com __

Re: Generator Arrow Functions

2013-11-12 Thread Axel Rauschmayer
spec. as a special form of generator function). > > I also need to think a bit about whether there might be any this binding > issues. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___

Re: an idea for replacing arguments.length

2013-11-10 Thread Axel Rauschmayer
e actual argument count. For example, one possibility would be > to allow the last item of any formal parameter list to be an item of the > syntactic form: > > ActualArgumentCount : '#' BindingIdentifier > > So, the declaration for splice could then b

Re: Creating top-level scopes in ES6 and do blocks

2013-11-04 Thread Axel Rauschmayer
strictness (compared to normal blocks + `let`). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Creating top-level scopes in ES6 and do blocks

2013-11-04 Thread Axel Rauschmayer
On 05 Nov 2013, at 6:35 , Mark S. Miller wrote: > On Mon, Nov 4, 2013 at 11:21 AM, Axel Rauschmayer wrote: > My bad: I should have made it clear that I wanted top-level blocks in strict > mode. Modules are implicitly in strict mode, normal code blocks aren’t. I was > looking

Re: Creating top-level scopes in ES6 and do blocks

2013-11-04 Thread Axel Rauschmayer
5:36 AM, Axel Rauschmayer wrote: >> What is the best way to create top-level scopes in ES6? > > I guess I am probably missing something important, but I thought you > could just write a block and use `let` in it: > >{ >let foo = ...; >... >} > &

Creating top-level scopes in ES6 and do blocks

2013-11-04 Thread Axel Rauschmayer
el -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Novel operator syntax

2013-10-29 Thread Axel Rauschmayer
nical computing if it introduces additional difficulties. > > With ES6 and these operators I believe JS/NodeJS could easily take over the > technical and statistical computing domains. > > Tristan -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twit

Re: Proposal to simplify Generators impact

2013-10-26 Thread Axel Rauschmayer
Another reason: you can’t have empty generators without marking them in some manner. > On Sat, Oct 26, 2013 at 1:01 PM, Lucio Tato wrote: > It's really needed to make js syntax more complex in order to implement > generators? > It's function* really needed? > -

Pass an environment to eval()?

2013-09-28 Thread Axel Rauschmayer
on`. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Destructuring object outside of var declaration

2013-09-17 Thread Axel Rauschmayer
bility-wise). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Continuing woes in reading the ES6 spec language

2013-09-15 Thread Axel Rauschmayer
nd why one would want to have default values in an order that is neither #1 nor #2. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Continuing woes in reading the ES6 spec language

2013-09-13 Thread Axel Rauschmayer
ed on this point. Thanks! I didn’t look at the spec section, I (incorrectly) assumed I knew how they worked. Then I don’t see a use case for this, I’d find it confusing. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com __

Re: Continuing woes in reading the ES6 spec language

2013-09-13 Thread Axel Rauschmayer
be useful. For example: ```js function getRandomInteger(lower = 0, upper) { return Math.floor(Math.random() * (upper - lower)) + lower; } ``` Implementing this function in some other manner is much more complicated. But I agree that you want to name parameters if there are more than 2

Functions in blocks?

2013-09-13 Thread Axel Rauschmayer
available in both sloppy and strict mode (right?). That seems like a pretty good solution (I also would have been OK with only having ES6 features in strict mode). Thanks! Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: 'void' as a value

2013-09-08 Thread Axel Rauschmayer
alue, done} creates another problem - heap pollution, this: > > var counter = 0; > for( var n of Range(0,10) ) > ++counter; > > should not cause heap allocations. In case of protocol you've described > {value, done} object gets allocated. And I suspect it is so on ea

Re: ImportSpecifierSet syntax

2013-09-08 Thread Axel Rauschmayer
The problem is that you have to bite the bullet of syntactic inconvenience for either default imports or normal imports. I’d prefer the syntax you suggested, but there seem to be many people who want to make default imports as simple as possible. -- Dr. Axel Rauschmayer rauschma.de [Sent from

Serve different JS files, depending on browser support?

2013-09-05 Thread Axel Rauschmayer
JS and then load modules conditionally? But that seems like a more complicated solution. I’m not even sure how I would implement the detection part. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ali

typeof null

2013-08-29 Thread Axel Rauschmayer
Quick, possibly silly idea: What if `typeof null` returned `undefined`? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Letting RegExp method return something iterable?

2013-08-29 Thread Axel Rauschmayer
:45 , Brendan Eich wrote: > Axel Rauschmayer wrote: >>> The fact that s.match(/re/g) returns the array of all matches (with >>> captures) sucks some of the oxygen away from any /re/g.execAll(s) proposal. >>> >>> But String.prototype.match has perlish hair (

Re: Letting RegExp method return something iterable?

2013-08-29 Thread Axel Rauschmayer
exec()`. Ideas: – execMulti() – execIter() `execAll()` may not be that bad. It’s not pretty, but it’s fairly easy to guess what it does (*if* one know what the normal `exec()` does). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma b

Re: Letting RegExp method return something iterable?

2013-08-29 Thread Axel Rauschmayer
ly the complete matches (group 0) are returned. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

RegExp. quoteText()

2013-08-28 Thread Axel Rauschmayer
could include parens, braces and brackets. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Optionally ignoring case in String.prototype.contains()?

2013-08-28 Thread Axel Rauschmayer
Suggestion: a named parameter `ignoreCase`: $ 'hello world'.contains('WORLD') false $ 'hello world'.contains('WORLD', { ignoreCase: true }) true -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitte

Re: `.toArray()` for all generators

2013-08-28 Thread Axel Rauschmayer
teratables? It would be lovely to have a module with tool functions for this, similar to Python’s itertools. http://docs.python.org/3/library/itertools.html -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com _

Re: Letting RegExp method return something iterable?

2013-08-28 Thread Axel Rauschmayer
it through list() first. > > Similarly, in JS you'd just pass it through Array.from() first. Additional option: ```js var arrayOfMatches = [ .../foo/.execMultipleLazy('str') ] ``` -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blo

Re: Creating and consuming custom iterators

2013-08-28 Thread Axel Rauschmayer
etIterator(obj) and > Reflect.defineIterator(obj, getIterator) for that? There will be a public symbol (that you can import from a system module) that will allow you to do both things. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.co

Re: Letting RegExp method return something iterable?

2013-08-24 Thread Axel Rauschmayer
An example to make things clearer (thanks for the suggestion, Domenic): https://gist.github.com/rauschma/6330265 On Aug 24, 2013, at 21:43 , Axel Rauschmayer wrote: > Well, obviously it doesn’t make much sense to do that for `text()`, but it > would be great to have for `exec()`. >

Re: Letting RegExp method return something iterable?

2013-08-24 Thread Axel Rauschmayer
Well, obviously it doesn’t make much sense to do that for `text()`, but it would be great to have for `exec()`. On Aug 24, 2013, at 21:39 , Axel Rauschmayer wrote: > At the moment, the following two methods abuse regular expressions as > iterators (if the /g flag

Letting RegExp method return something iterable?

2013-08-24 Thread Axel Rauschmayer
-- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Optional Strong Typing

2013-08-23 Thread Axel Rauschmayer
12.3853 > http://devsmash.com > @jmar777 > > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/

Re: Refutable destructuring

2013-08-09 Thread Axel Rauschmayer
ifier binding]". I agree. `+` may be a better choice (reminiscent of regular expressions as opposed to the boolean operator). Then the code becomes: let { +a: foo, b: bar } = { a: 1 }; // foo = 1, b = undefined let { +a: foo, b: bar } = { }; // exception function bla(+mandatoryA

Refutable destructuring

2013-08-09 Thread Axel Rauschmayer
declaratively specify a minimum arity). Then destructuring assignment and parameter handling would work very similarly. function bla(!mandatoryArg, optionalArg1, optionalArg2 = 123) { ... } Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com

Modules: do re-exports also import?

2013-08-04 Thread Axel Rauschmayer
} from "crypto"; // re-exporting specified exports from another module That seems redundant. Maybe one could mark things that should be re-exported when importing them? On the other hand, this may be rare enough that it doesn’t warrant the extra syntax. -- Dr. Axel Rauschmay

Re: typeof extensibility, building on my Value Objects slides from Thursday's TC39 meeting

2013-07-28 Thread Axel Rauschmayer
not ES7. First, operators for value objects. Makes sense. Maybe the syntax/API for setting up operators can be designed in a way that keeps the option open of adding complete multiple dispatch later (or via a library). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.c

Re: typeof extensibility, building on my Value Objects slides from Thursday's TC39 meeting

2013-07-28 Thread Axel Rauschmayer
). MD is very useful for working with data (web services, JSON, etc.), where you don’t want to (or can’t) encapsulate behavior with data. Design-wise, they make functions aware of object-orientation so that you can use them to implement algorithms that span multiple classes (as binary op

Re: typeof extensibility, building on my Value Objects slides from Thursday's TC39 meeting

2013-07-28 Thread Axel Rauschmayer
d combine single dispatch and multiple dispatch to implement the DCI ideas): http://www.artima.com/articles/dci_vision.html On Jul 29, 2013, at 0:41 , Brendan Eich wrote: > Axel Rauschmayer wrote: >> Suggestion: put this evolving spec into a Gist or something similar. > > Defi

Re: typeof extensibility, building on my Value Objects slides from Thursday's TC39 meeting

2013-07-28 Thread Axel Rauschmayer
it and singular, contrary to reality in browsers). > > /be > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Modules: error handling when importing declaratively?

2013-07-28 Thread Axel Rauschmayer
event listener with the current loader, but haven’t found anything in the loader API. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Array.prototype.last

2013-07-28 Thread Axel Rauschmayer
gt; didn't agree on a method or getter. Hence the need for a standard :-) > Array.prototype.first could work too. > > David > > [1] https://twitter.com/angustweets/status/359827047117373443 > ___ > es-discuss mailing list >

Re: More concise arrow functions

2013-07-27 Thread Axel Rauschmayer
an >> having zero params (due to paranthesis requirement). >> >> I think the semicolon hazard is enough to make omitting the body >> questionable, but omitting the params is an easy win with no downside. >> ___ >>

<    1   2   3   4   5   6   7   8   9   10   >