Home /Modules/tests/extended-for-loop-health-guards.sleela

extended-for-loop-health-guards.sleela

tests/proposals/extended-for-loop-health-guards.sleela · 14 line(s) · sleela

# Extended for-loop health guards (proposed)

# The fourth term is a Boolean thread-memory stability signal.
for (let i = 0; i < 100; i = i + 1; threadStable) {
    processItem(i);
}

# The fifth term is a Boolean VM GC/heap health signal.
# A false heapHealthy value must follow the runtime's configured
# diagnostic-flag or memory-health-exception policy.
for (let i = 0; i < 100; i = i + 1; threadStable; heapHealthy) {
    processItem(i);
}