4 ms·
Zig supports the 2nd and 3rd clause already in its while loop. Would it kill it to accept an initializer and look more like other languages instead of having a
by david2ndaccount 4y ago
Zig supports the 2nd and 3rd clause already in its while loop. Would it kill it to accept an initializer and look more like other languages instead of having a special snowflake syntax.
Is this (note the enclosing braces)
{
var thing = thinger();
while(cond(thing)) : (mutate(thing)){
// do whatever
}
}
really better than this?
for(var thing = thinger(); cond(thing); mutate(thing)){
// do whatever
}