I'd like to suggest another sense in which you may have gone down a bad path:
you're assuming that await is paired with function*, but it could instead be
(like C#) paired with its own async-function syntactic form. Let's say for the
sake of argument that async is just a keyword that takes a
On Jan 27, 2014 2:09 PM, David Herman dher...@mozilla.com wrote:
I'd like to suggest another sense in which you may have gone down a bad
path: you're assuming that await is paired with function*, but it could
instead be (like C#) paired with its own async-function syntactic form.
Let's say for
Could not get the example deferred function to work with traceur from the
wiki page to see what it generates.
https://github.com/google/traceur-compiler/wiki/LanguageFeatures
Been talking off list since this is off topic, but keeps coming up. I ended
up following Brendan's advice. I have a
Bradley Meck wrote:
Unsure on how new syntax features like await should deal w/ multiple
operands though, like if await wanted to turn multiple promises into
an array. Comma operator takes comma separated list out of the equation.
No one proposed this. Do you have a use-case? Task.js and
This is more just a comment / thinking out loud about syntax. Not related
to a specific use case. The following is just what was starting to bring my
thoughts around to that though.
I am starting to build things with the constructs in this thread, so
building out things in a similar manner to
Le 24 janv. 2014 à 10:06, Bradley Meck bradley.m...@gmail.com a écrit :
(...) I still have to use new when invoking the generator function which
feels dirty in my mind.
Interestingly, using `new` when invoking a generator function feels cleaner in
my mind. :-) In short (and since it is
[replying to a message you sent off-list, hope it is ok. /be]
Brendan Eich wrote:
Bradley Meck wrote:
Perhaps, but I am still a bit concerned functionality wise that I do
not have a clean way to force the `new generator()` piece of code to
be inside of the generator.
I think you've gone
On Jan 23, 2014, at 4:49 PM, Brendan Eich bren...@mozilla.com wrote:
Domenic Denicola wrote:
Task.js is still on JavaScript1.8, and is not ES6-compatible. It won't
work with modern browsers, or with Regenerator.
Fork and fix, should be easy. I expect a PR would be accepted in due course.
Taking note with async polyfills and syntax for a minute. I spent a fair
amount of time actually writing the spec of my intent/goal after getting
some thought and working things through in my head (varies slightly from
old 2011 await):
It seems like this is largely a matter of personal aesthetics (feels dirty,
hacky, etc.) but nothing is wrong or even hard functionally. Furthermore
given the prevalence of code out there that uses such hacks without
compunction, it seems that your aesthetics are not shared by most.
Maybe the
Perhaps, but I am still a bit concerned functionality wise that I do not
have a clean way to force the `new generator()` piece of code to be inside
of the generator.
I cannot easily convert it akin to how new can be caught:
```
function* generatorFn() {
if (this instanceof generatorFn) {
Bradley Meck wrote:
Perhaps, but I am still a bit concerned functionality wise that I do
not have a clean way to force the `new generator()` piece of code to
be inside of the generator.
I think you've gone down a bad path. Even without task.js, couldn't you
put the promises .then'ing in the
I was playing around with generators / looking at await for promises and
notices a very difficult thing revolving around generators not having a
reference to themselves.
See:
https://gist.github.com/bmeck/72a0f4f448f20cf00f8c
I have to end up wrapping the generator function to get a reference
When writing a generator as, for example, an instance method of a class, it
would be very surprising for its 'this' to be bound to something other than
the class' instance.
On Thu, Jan 23, 2014 at 2:14 PM, Bradley Meck bradley.m...@gmail.comwrote:
I was playing around with generators / looking
arguments.callee.caller would have done that /trolling
/but-actually-not-so-much
On Thu, Jan 23, 2014 at 2:14 PM, Bradley Meck bradley.m...@gmail.comwrote:
I was playing around with generators / looking at await for promises and
notices a very difficult thing revolving around generators not
Andrea Giammarchi wrote:
arguments.callee.caller would have done that /trolling
/but-actually-not-so-much
No, Bradley wants the generator-iterator (what ES6 draft calls a
Generator), not the generator function (GeneratorFunction). Any .callee
would have to be a function, so a
Is that true even though then should fire after the generator unwinds its
stack? I am using regenerator right now while playing with this stuff.
On Jan 23, 2014 5:43 PM, Brendan Eich bren...@mozilla.com wrote:
Andrea Giammarchi wrote:
arguments.callee.caller would have done that /trolling
Bradley Meck wrote:
Is that true even though then should fire after the generator unwinds
its stack?
True if .then always runs in a later turn -- sorry.
Still, my point stands: you are not using task.js-like
scheduler/combinator approach for an apples-to-apples comparison with
await. If you
Task.js is still on JavaScript 1.8, and is not ES6-compatible. It won't work
with modern browsers, or with Regenerator.
On Jan 23, 2014, at 19:43, Brendan Eich bren...@mozilla.com wrote:
Bradley Meck wrote:
Is that true even though then should fire after the generator unwinds its
stack?
Domenic Denicola wrote:
Task.js is still on JavaScript1.8, and is not ES6-compatible. It won't work
with modern browsers, or with Regenerator.
Fork and fix, should be easy. I expect a PR would be accepted in due
course. SpiderMonkey seems to have ES6 generator support somewhat there
On Jan 23, 2014, at 2:14 PM, Bradley Meck wrote:
I was playing around with generators / looking at await for promises and
notices a very difficult thing revolving around generators not having a
reference to themselves.
See:
https://gist.github.com/bmeck/72a0f4f448f20cf00f8c
I have
Still, my point stands: you are not using task.js-like
scheduler/combinator approach for an apples-to-apples comparison with
await. If you do, then we're down to the obligation of a task.js download,
and some syntactic sugar.
see comments in gist, adding a library also has some stuff with
On 1/23/2014 4:46 PM, Domenic Denicola wrote:
Task.js is still on JavaScript 1.8, and is not ES6-compatible. It won't work
with modern browsers, or with Regenerator.
For most uses, Task.js's Task.spawn can be replaced with a smaller
helper function:
```js
function spawn(thunk) {
return
23 matches
Mail list logo