After some late night reading of the C99 spec, I’ve found quite a few hidden gems. I’m going to start posting some of these. Since it’s late, I’ll just post a teaser.

On page 64 of the C99 standard it says:

In all aspects of the language, the six tokens

<: :> <% %> %: %:%:

behave,respectively,the same as the six tokens

[ ] { } # ##

except for their spelling.

Really? Then let’s try this program:

%:include <stdio .h>
int
main(int argc, char *argv<::>)
<%
.printf("hello world\n");
%>

Compile it an run it:

dirac src $ gcc main.c
dirac src $ ./a.out
hello world

Whaddaya know… I know, I know… useless. Wait for the next post then.