Re:A simple defer feature for C
by taeber on Monday January 17, 2022 @08:11AM
(#29966185)
I'm glad you suggested that, because one of the first comparisons I drew in my article[1] about the "with"-syntax was how it looks like a for-loop.
If you are interested, I did provide a few macros[2], but as another commenter pointed out, they won't handle an early return. You can use "break" to exit early though:
If you are interested, I did provide a few macros[2], but as another commenter pointed out, they won't handle an early return. You can use "break" to exit early though:
There's also "withif" [1]https://github.com/taeber/cwith[2]https://github.com/taeber/cwith/blob/master/with.h