Skip to content

Instantly share code, notes, and snippets.

@ozten
Forked from disnet/annotate.js
Created June 10, 2014 20:47
Show Gist options
  • Save ozten/8fa2f35d400e38b528dd to your computer and use it in GitHub Desktop.
Save ozten/8fa2f35d400e38b528dd to your computer and use it in GitHub Desktop.
macro def {
rule {
$name:ident ( $($params:ident : $type:ident) (,) ...) $body
} => {
// just throwing away the type annotation. The semantics of type
// annotations left as an exercise to the reader :)
function $name ($params (,) ...) $body
}
}
def add (a : Number, b : Number) {
return a + b;
}
add(1,2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment