d at domenic.me (2015-03-06T00:38:13.411Z)
El 23/02/2015 20:29, "Brendan Eich" <brendan at mozilla.org> escribió: > What would have to go in the XXX that's self-hostable, and how would generators that participate have to be written? This is what I was trying to find. Some way of copying without altering client function. Let's see.
El 23/02/2015 20:29, "Brendan Eich" <brendan at mozilla.org> escribió: > > Benjamin (Inglor) Gruenbaum wrote: >> >> Of course this example is contrived! It's the simplest example I could think of. I do think it stands for every example of any iterator that takes any input from `.send` or `.throw`. I have plenty of other contrived examples (implementing `fork` like this by using generators for coroutines with promises is at least mildly cool). > > > I <3 fork, Unix kid here. Still, agree here: In the other post I mentioned just this case. I was writing a transpiler for a programming language that uses some sort of clone {} block acting like a fork() where the child process executes the code inside the block but the parent not. A goto() for generators or a clone() method could simplify the transpilled code as now I'm using switchs statements. > > >> That said I absolutely agree that more practical examples are required in order to make this already way-powerful two way protocol into something even more complicated. > > > Another consideration beyond just the needs-justification language power-up -- the implementation burden goes up too. You're talking about cloning an activation. Easy in the unoptimized world of generators today, not so much in the future. > > It may be worth it, but we need to feel the "back-pressure" from developers using generators, first. > > Can developers use conventions and APIs to implement `clone` today? I.e., > > Object.defineProperty(function*(){}.prototype.__proto__, 'clone', {value: XXX, writable: true, configurable: true, enumerable: false}); > > What would have to go in the XXX that's self-hostable, and how would generators that participate have to be written? This is what I was trying to find. Some way of copying without altering client function. Let's see. > > > /be > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150223/e30f8721/attachment.html>