Metaprogramming custom control structures in C
chiark.greenend.org.uk
chiark.greenend.org.uk
This control structure trick, despite being more esoteric looking than any of those, is both useful in practice and standard C. If you're defining a custom data container in C, it will let you write a foreach macro that doesn't require the user to declare any temporaries you need to use, doesn't break the break and continue statements, and doesn't require any weird syntax at the beginning of end of the loop. I highly recommend reading about it.
For a (poorly documented) example of actual use from some code I wrote, see HTAB_FOREACH:
https://github.com/comex/substitute/blob/master/lib/cbit/hta...
and the LET_LOOP macro it uses:
https://github.com/comex/substitute/blob/master/lib/cbit/mis...