Loops and types

I absolutely intended to argue that. Moving code around is part of everyone’s workflow, and good scoping rules help prevent bugs - Zig’s strict shadowing rules gives you a lot of confidence when doing so!

I actually don’t think anyone would start arguing for removing a while-loop construct that allowed for scoping of loop variables, if it existed. The question is if it’s worth adding in now.

2 Likes