Skip to content

Instantly share code, notes, and snippets.

@drslump
Created November 14, 2013 23:27
Show Gist options
  • Save drslump/7476285 to your computer and use it in GitHub Desktop.
Save drslump/7476285 to your computer and use it in GitHub Desktop.
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