language · language ·
Planned collection mutation
plan remove, removeAt, add, and addAt describe mutations to apply around iteration without mutating the active traversal directly.
For Kyber-ready code, collect intended changes separately and apply them after the loop.
plan remove expression
plan removeAt index
plan add value
plan addAt index valueStatus: generated-cpp-only
Complete program
Queue a structural collection edit while reading the original iteration snapshot.
cpu · language · type checked
list of int scores = [10, -1, 20]
for score at index in scores
{
if score < 0 { plan remove score }
}
for score in scores { Console.Log(Text.From(score)) }
project.mech
manifestVersion = "2"
package = "api.example.language__planned_loop_mutations"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
Complete program
Queue a structural collection edit while reading the original iteration snapshot.
cpu · language · type checked
list of int scores = [10, -1, 20]
for score at index in scores
{
if score < 0 { plan removeAt index }
}
for score in scores { Console.Log(Text.From(score)) }
project.mech
manifestVersion = "2"
package = "api.example.language__planned_loop_mutations"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
Complete program
Queue a structural collection edit while reading the original iteration snapshot.
cpu · language · type checked
list of int scores = [10, -1, 20]
for score at index in scores
{
if score < 0 { plan add 5 }
}
for score in scores { Console.Log(Text.From(score)) }
project.mech
manifestVersion = "2"
package = "api.example.language__planned_loop_mutations"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
Complete program
Queue a structural collection edit while reading the original iteration snapshot.
cpu · language · type checked
list of int scores = [10, -1, 20]
for score at index in scores
{
if score < 0 { plan addAt index 5 }
}
for score in scores { Console.Log(Text.From(score)) }
project.mech
manifestVersion = "2"
package = "api.example.language__planned_loop_mutations"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
Notes and source
Planned loop mutation is generated-C++ only.
The explicit two-phase alternative is easy to inspect and portable across current targets.
yeho/conformance-2026.1.json: planned-loop-mutations; parser_statements.cpp