4 ms·
I'm new to Zig but I think this is how you would do it: { var i: usize = 0; while (i < 10) : (i += 1) { // use i }
by canadaduane 5y ago
I'm new to Zig but I think this is how you would do it:
{
var i: usize = 0;
while (i < 10) : (i += 1) {
// use i
}
}
- tored 5y agoLooks like a solution, a bit annoying to introduce an extra block.
- abainbridge 5y agoYeah. And it fails the "make the easy way the right way" test of language design.
- dnautics 5y agoI give a c-like for loop (or while loop) a 40% odds of making it into the language. That number being pulled out of my nether regions.