Post #1961720
2026-05-04 01:59 UTC
Replies (8)
-
@vchakhno@mathstodon.xyz 2026-05-04 02:43
@typeswitch Oh wow I didn't think about composing them in this way. I was a bit skeptical about invoking the macros directly after `for` and putting them in charge of binding, but now that I see it allows to introduce other block statements in between the for keyword and the body, it just *feels* right. This is pretty neat!
-
@aburka@hachyderm.io 2026-05-04 04:42
@typeswitch bravo
-
@SnoopJ@hachyderm.io 2026-05-04 04:45
@typeswitch thanks I refuse to have an opinion about it
-
@vchakhno@mathstodon.xyz 2026-05-04 06:21
@typeswitch I can't believe that last part is getting the least amount of favorites, it's the most interesting by far!
-
@rburchell@mastodon.social 2026-05-04 07:43
@typeswitch fantastically cursed :)
-
@JamesWidman@mastodon.social 2026-05-04 09:45
@typeswitch ok, (1) this rules. (2) in case anyone cares: - Clang 22 and GCC 15 introduced support for the new ISO C feature for named loops* - the GNU C feature, statements-and-declarations-in-expressions**, can be used in lots of interesting places; e.g. ternary expressions; in the final /expression/ part of the header of a for-loop; etc. [*] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm [**] https://gcc.gnu.org/onlinedocs/gcc-3.2.2/gcc/Statement-Exprs.html
-
@Steel_Virgin@eldritch.cafe 2026-05-04 10:24
@typeswitch ok now I just have no idea what ## are. it feels cool. I wanna learn this. but it feels like nobody would want me to use this in a company the same way they didn't want me to do nested list comprehensions in python… or ternary operators in C. Or anything that you would need to know the langage specificaly to understand the code (basicaly mister boss wants to be able to believe he could have done it himself 😔)
-
@fanf@mendeddrum.org 2026-05-04 17:20
@typeswitch heh :-) have you seen simon tatham’s article on custom control structures? https://www.chiark.greenend.org.uk/~sgtatham/mp/