C99 and D

問題。

i@u ~/test/d> diff comment.c comment.d                           ~/test/d 21:47
i@u ~/test/d> gcc -o comment comment.c                           ~/test/d 21:48
i@u ~/test/d> ./comment                                          ~/test/d 21:48
it's c code
i@u ~/test/d> dmd comment.d                                      ~/test/d 21:48
gcc comment.o -o comment -lphobos -lpthread -lm
i@u ~/test/d> ./comment                                          ~/test/d 21:48
it's d code

答え。

int dummy = 1/+1;
int main() {
  printf("it's c code\n");
  return 0;
}
/*
 +/;
int main() {
  printf("it's d code\n");
  return 0;
}
/**/

簡単ね。もうちょっとエレガントにできると良いかも。

なにかあれば下記メールアドレスへ。
shinichiro.hamaji _at_ gmail.com
shinichiro.h