root/trunk/infrastructure/pyd/generators/callable_wrap.py

Revision 27, 506 bytes (checked in by KirkMcDonald, 2 years ago)

PyCallable? to delegate conversion.

Line 
1 import sys
2 old_stdout = sys.stdout
3 sys.stdout = open('callable_wrap.txt', 'w')
4
5 template = """\
6     Tr fn(Tr, %s)(%s) {
7         return boilerplate!(Tr)(call(%s));
8     }
9 """
10
11 for i in range(1, 11):
12     t_args = []
13     f_args = []
14     c_args = []
15     for j in range(1, i+1):
16         t_args.append("T%s" % j)
17         f_args.append("T%s t%s" % (j, j))
18         c_args.append("t%s" % j)
19     print template % (", ".join(t_args), ", ".join(f_args), ", ".join(c_args))
20
21 sys.stdout = old_stdout
Note: See TracBrowser for help on using the browser.