3 ms·
Well, I suppose downvotes are what I get for commenting at 6 in the morning at 35,000 ft. Correct, as the article mentions Harmony takes many cues from Python,
by doublerebel 14y ago
Well, I suppose downvotes are what I get for commenting at 6 in the morning at 35,000 ft. Correct, as the article mentions Harmony takes many cues from Python, as does Coffee, and Coffee cannot magically create features that aren't supported by the underlying JS.
However, it is possible to get a near-equivalent of generators (albeit with more overhead) using Continuation Passing Style and Iced CoffeeScript await/defer or another CPS lib. There are many who have explored this concept before myself, and I am now inspired to create an example to demonstrate IcedCS's ability with such a concept once I'm through the holiday.
- yuchi 14y agoActually, using ICS and CPS to build generators forces a reversed approach. With generators is the called function to own the process, in await/defer is the calling context which knows about the "generator like" functionality. And you're completely right about Coffee not able to implement ES6 generators.