Skip to content

For generators are eager in values, but should be lazy #398

Open
@bioball

Description

x = new {
  ["one"] = 1
  ["two"] = this["one"] + 1
}

y = (x) {
  for (k, v in x) {
    [k] = v + 1
  }
}

Here, y["two"] should be 4, not 3.

for (v in x) {} should iterate over lazy values, and for (k, v in x) {} should iterate over eager keys and lazy values.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions