Skip to content

Instantly share code, notes, and snippets.

@jlongster
Created October 12, 2012 00:02
Show Gist options
  • Save jlongster/3876506 to your computer and use it in GitHub Desktop.
Save jlongster/3876506 to your computer and use it in GitHub Desktop.
sweet.js macros
macro def {
case $name:ident $params $body => {
function $name $params $body
}
case $params $body => {
function $params $body
}
}
def foo(a, k) {
k(a + 1);
}
foo(1, def(x) {
console.log(x);
});
@potch
Copy link

potch commented Oct 12, 2012

I am so excited about this stuff you guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment