Re:Do notation considered harmful
by jcelerier on Friday May 01, 2020 @06:29PM
(#23047198)
> You very conveniently skipped that you cant build async /await in C without modifying the language.
but async / await is semantics, not syntax, thus completely irrelevant to the conversation. you want an example of building async / await into the syntax of C as a library ? tada !
or maybe you would prefer the more "modern" version, still compatible with pure C89 syntax though ?
#define async
#define await (void)
int main(int argc, char** argv) {
auto x = async printf("foobar");
/* wow, you can even compose it ! */
auto y = async 2 * x;
await x;
}
but async / await is semantics, not syntax, thus completely irrelevant to the conversation. you want an example of building async / await into the syntax of C as a library ? tada !
or maybe you would prefer the more "modern" version, still compatible with pure C89 syntax though ? please go on, this is super entertaining !