2 ms·
That's a very different thing and you know it. Indentation is syntax. You can't just omit braces and expect it to parse.
by 8n4vidtmkvmk 2y ago
That's a very different thing and you know it. Indentation is syntax. You can't just omit braces and expect it to parse.
- dgfitz 2y agoZig treats unused variables as a syntax error.
- smallstepforman 2y agoLets say I gather Diag data, which I conditionally print during testing. Are you saying that I cannot leave the diag code in place after I comment out the print function? Thats unproductive and a major obstacle to using Zig. I’m still pissed at Andrews stance of preventing Tabs, operator overloading, polymorphism, and this just seals my “stay away” stance. I really do want to like Zig, but cannot.
- kcbanner 2y agoYou don't need to comment out the print function - it could gate its behavior on a comptime-known configuration variable. This would allow you to keep your debug variables in place.
- 8n4vidtmkvmk 2y agoIt doesn't need to though. It goes out of its way to determine that the variable is unused.