I\'m writing some C at the moment and because I like whitespace sensitive syntax, I\'d like to write it like this:
#include
int main(void)
PythoidC is a braceless C language http://pythoidc.googlecode.com
c.include(c.h.stdio)
c.include(c.h.stdlib)
int fib(int n):
if (n<=2):
return 1
else:
return fib(n-1) + fib(n-2)
int main(int argc, char **argv):
int n //C style annotation
n=c.stdlib.atoi(argv[1])
c.stdio.printf('fibonacci(%d)=%d\n', n, fib(n))
PythoidC automatically generates the following C code:
int fib(int n){
if (n<=2){
return 1;}
else{
return fib(n-1) + fib(n-2);}}
int main(int argc, char **argv){
int n ;//C style annotation
n=atoi(argv[1]);
printf("fibonacci(%d)=%d\n", n, fib(n));
}