Skip to content

Instantly share code, notes, and snippets.

@fabriceleal
Created November 15, 2012 21:41
Show Gist options
  • Save fabriceleal/4081503 to your computer and use it in GitHub Desktop.
Save fabriceleal/4081503 to your computer and use it in GitHub Desktop.
js function-shortcut macro
macro λ {
case $params $body => {
(function $params $body)
}
case $name:ident $params $body => {
(function $name $params $body)
}
}
var a = λ (a) {
console.log(a);
};
a('hello world');
@fabriceleal
Copy link
Author

Shamelessly copied from sweetjs.org. Instead of def, use λ

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