apple / apple/pkl

For generators are eager in values, but should be lazy

Open
#398 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
11.5k
Forks
402
Avg merge
1d 15h
Merged PRs (30d)
20

Description

```groovy
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.

Contributor guide

Open the contributing guide

Research direction

The issue names no file, test, or entry point. Start by locating the implementation and tests for generator for-loops, then verify the example produces y["two"] as 4 and that single-value iteration remains lazy.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.