-
-
Save vendethiel/cdc4167f6492f2f62bf2 to your computer and use it in GitHub Desktop.
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
use 007; # no missing _ | |
macro gen-gen(names) { | |
my macros = names.each(-> name { | |
my id = Q::Identifier.new('gen-'~name); # | |
return quasi { | |
macro {{{id}}}(operators) { | |
my operators = operators.map(-> category, operator) { | |
sub {{{ {{{ name }}} }}}:{{{ operator @ Q::Literal::Str }}} { | |
}; | |
}; | |
return operators; # XXX do we need to wrap this because it's an array? | |
}; | |
}; | |
}); | |
return macros; # XXX do we need to wrap this because it's an array? | |
}; | |
gen-gen(['infix']); | |
gen-infix({add: '+'}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment