Created
November 14, 2013 23:27
-
-
Save drslump/7476285 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import Boo.Lang.Compiler.Ast | |
def Method1(x, y): | |
print 'Method1', x, y | |
def Method2(x, y, z): | |
print 'Method2', x, y, z | |
macro BindArg(expr as Expression): | |
for fn in ('Method1', 'Method2'): | |
re = ReferenceExpression(fn) | |
yield [| | |
def $re(*args): | |
args = (of object: $expr,) + args | |
Boo.Lang.Runtime.RuntimeServices.InvokeCallable($re, args) | |
|] | |
BindArg 10 | |
Method1('foo') | |
Method2('foo', 'bar') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment