Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

please never use this

DiscordLines of codeMinimum C version: 78 (K&R)GitHub

adds the wonderful else clause of for and while from python back to C78

why are you reading this example

#include<stdio.h>/* include_as = macro: define `PY_FOR(...)` and `PY_WHL(...)` *//* include_as = syntax_extension: same as macro, but also override `for(...)` and `while(...)` */#defineinclude_as syntax_extension
#include"pythonelse.h"intmain(void) {
for (inti=0; i<10; i++) {
printf("i: %d\n", i);
} else {
printf("stop. don't use this library. why. WHY.\n");
}
for (inti=0; i<10; i++) {
printf("i: %d\n", i);
if (i==5) break;
} else {
printf("pictured: dead code\n");
}
return0;
}

About

adds the wonderful and very intuitive `else` clause of `for` and `while` from python back to C

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Contributors

Languages