Skip to content

Instantly share code, notes, and snippets.

@paraboul
Created March 14, 2012 16:03
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save paraboul/2037497 to your computer and use it in GitHub Desktop.
Save paraboul/2037497 to your computer and use it in GitHub Desktop.
JavaScript + C Preprocessor
/usr/bin/cpp -P -undef -Wundef -std=c99 -nostdinc -Wtrigraphs -fdollars-in-identifiers -C < foo.js
#define IN(ms) setTimeout(function() { setTimeout(___in_x, ms); }, 0); var ___in_x = function()
#include "other.js"
#define FOO "bar"
/* Killing Continuous-passing-style */
function foo() {
IN(100) {
console.log(FOO);
}
}
foo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment