According to Microsoft, the goal of the project is to create a safer platform for memory management.[3]
while_sum(x: List[U32]) : U32
{
var sum: U32 = 0;
let iter = x.values();
while { iter.has_value() }
{
// This has to be `a`, same as in the for loop above
let a = iter();
// Increments the iterator
next iter;
// This is the body of the for loop
sum = sum + a
}
sum
}