Monday, September 8, 2008

Fun With Digraphs

Christ, I can't believe this compiles-
%:include <stdio.h>
%:include <Cocoa/Cocoa.h>

int main()
<%
NSString *message = @"Hello, world";

printf("%s\n", <:message UTF8String:>);

return 0;
%>

It's section 6.4.6 in the C spec. Good stuff for playing jokes on coworkers, but please don't ship code like this.