Created
November 15, 2012 21:41
-
-
Save fabriceleal/4081503 to your computer and use it in GitHub Desktop.
js function-shortcut macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shamelessly copied from sweetjs.org. Instead of
def
, useλ