assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

Support generators

Open jtenner opened this issue 7 years ago • 2 comments

This sort of feature would help us develop features like Array.prototype.entries, Array.prototype.values, and other features that require generators.

For instance:

class Array<T> {
  *values(): Iterator<T> {
    var length = this.length_;
    for (let i = 0; i < length; i++) {
      yield this.__unchecked_get(i);
    }
  }
}

jtenner avatar Nov 29 '18 18:11 jtenner

I will collect and share helpful articles about generators here:

  1. https://mapping-high-level-constructs-to-llvm-ir.readthedocs.io/en/latest/advanced-constructs/generators.html

MaxGraey avatar May 16 '20 08:05 MaxGraey

Years passed, Is there any plan/news for this?

leeho0108 avatar May 08 '25 08:05 leeho0108