Re: Extended dot notation (pick notation) proposal

2016-09-21 Thread Olivier Lalonde
code to 1 line. Their shared curiosity may be a coincidence; or it >> may be the language's fault. Presume the latter. It doesn't follow that the >> answer should be yes. Since all new syntax imposes some mental load on all >> language users, the answer should be no unless

Re: Proposal: add an option to omit prototype of objects created by JSON.parse()

2016-09-29 Thread Olivier Lalonde
>> // equivalent to >>> JSON.parse(str, {reviver: someFunc}); >>> ``` >>> >> Looks reasonable. >> >> Maybe we can simply add another method, say `JSON.parseWithoutPrototype()`. >> This makes feature detection easier. >> >> >> >> ___ >> es-discuss mailing list >> es-discuss@mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> > > > > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -- - Oli Olivier Lalonde http://www.syskall.com <-- connect with me! ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Support () => {}() syntax?

2016-09-29 Thread Olivier Lalonde
this has been discussed before. -- - Oli Olivier Lalonde http://www.syskall.com <-- connect with me! ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Support () => {}() syntax?

2016-09-29 Thread Olivier Lalonde
t; > > On Thu, Sep 29, 2016 at 3:14 PM Michał Wadas > wrote: > >> Similar proposal is already here, do expressions. >> > > Additionally... > >> >> On 30 Sep 2016 12:06 a.m., "Olivier Lalonde" wrote: >> >>> I occasionally write IIFE

Re: Support () => {}() syntax?

2016-09-29 Thread Olivier Lalonde
Do "do expressions" support the "await" keyword? On Thu, Sep 29, 2016 at 3:59 PM, Rick Waldron wrote: > > > On Thu, Sep 29, 2016 at 3:14 PM Michał Wadas > wrote: > >> Similar proposal is already here, do expressions. >> > > Additionally..

Re: Support () => {}() syntax?

2016-09-30 Thread Olivier Lalonde
le to do more complicated stuff with the > result means inline promise-chaining without having to asyncify your > whole function!) > > ~TJ > ___________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-disc

Re: Array tail destructuring

2016-10-01 Thread Olivier Lalonde
> ``` > function* ones(){ while(true) yield 1; } > var [...a]=ones(); // freezes > ``` So if that freezes, whats the problem with `[...a, last]`? It would just freeze as well... > access to array elements may have side effects Doesn't `[a, b,...vals]` access array elements? On Sat, Oct 1, 2016

Re: Array tail destructuring

2016-10-02 Thread Olivier Lalonde
> On Sat, Oct 1, 2016 at 12:29 PM, Olivier Lalonde > wrote: > >> > ``` >> > function* ones(){ while(true) yield 1; } >> > var [...a]=ones(); // freezes >> > ``` >> >> So if that freezes, whats the problem with `[...a, last]`? It would

Re: Array tail destructuring

2016-10-03 Thread Olivier Lalonde
M, Caitlin Potter > wrote: > > On Oct 2, 2016, at 10:50 AM, Awal Garg wrote: > >> On Oct 2, 2016, at 9:30 AM, Olivier Lalonde wrote: > >>> So what's the problem with `[...a, last]` that `[...a]` doesn't have? I > >>> still don't get it. >

Proposal: `await [p1, p2]` (equivalent to `await Promise.all([p1, p2])`)

2016-10-26 Thread Olivier Lalonde
I have no idea if this has been discussed already but I thought it'd be nice to have the following syntax sugar for async/await. The idea would be that any array that follows `await` would be wrapped into a Promise.all() call. For example, `await [p1,p2]` would be the equivalent of `await Promise.

Re: Proposal: `await [p1, p2]` (equivalent to `await Promise.all([p1, p2])`)

2016-10-26 Thread Olivier Lalonde
I don't think so, what do you mean? On Wed, Oct 26, 2016 at 12:22 AM, Raul-Sebastian Mihăilă < raul.miha...@gmail.com> wrote: > Then Promise.resolve([p1, p2]) should be like Promise.all([p1, p2]) ? > > ___ > es-discuss mailing list > es-discuss@mozilla.

Re: Proposal: `await [p1, p2]` (equivalent to `await Promise.all([p1, p2])`)

2016-10-26 Thread Olivier Lalonde
of `Promise`s, *not* an array > of > their corresponding completion values. > > On Wednesday, October 26, 2016 12:11:36 AM CEST Olivier Lalonde wrote: > > I have no idea if this has been discussed already but I thought it'd be > > nice to have the following syntax sugar fo

Re: Proposal: `await [p1, p2]` (equivalent to `await Promise.all([p1, p2])`)

2016-10-26 Thread Olivier Lalonde
ou want `await` syntax for `Promise.all`, you'd need different syntax > for it - and then, what about `Promise.race`? What about other future > combinators? > > On Wed, Oct 26, 2016 at 12:25 AM, Olivier Lalonde > wrote: > >> I don't think so, what do you mean

Re: Proposal: `await [p1, p2]` (equivalent to `await Promise.all([p1, p2])`)

2016-10-26 Thread Olivier Lalonde
In the scenario above, you could pass an array of files, or a `Promise` > that resolves > to said array; the function accepts both. > > On Wednesday, October 26, 2016 1:03:37 AM CEST Olivier Lalonde wrote: > > I didn't realize `await` could be used on non-`Promise`s,

Re: Re: Proposal: expression mode (=)

2016-10-29 Thread Olivier Lalonde
Sounds like the "do expressions" proposal. http://wiki.ecmascript.org/doku.php?id=strawman:do_expressions On Sat, Oct 29, 2016 at 5:32 PM, Yongxu Ren wrote: > potentially, this syntax can be extended to functions > ``` > function f() ={stat} > // is equivalent to > function f() {return stat} > >