language · keyword ·
addAt
Add a planned item at an index
For Kyber-ready code, collect intended changes separately and apply them after the loop.
addAtStatus: 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 addAt index 5 }
}
for score in scores { Console.Log(Text.From(score)) }
project.mech
manifestVersion = "2"
package = "api.example.word__addat"
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