Show
Ignore:
Timestamp:
10/24/06 01:24:13 (2 years ago)
Author:
KirkMcDonald
Message:

Meta-programming library replaced; large re-write. StackThreads? updated to 0.3.2. Iteration updates.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/infrastructure/pyd/generators/min_args.py

    r26 r40  
    33sys.stdout = open('min_args.txt', 'w') 
    44 
    5 arg_template = """ArgType!(fn_t, %s).init""" 
     5arg_template = """I!(%s)()""" 
    66 
    77template = """\ 
    8     else static if (is(typeof(fn(%s)))) 
    9         const uint MIN_ARGS = %s;""" 
     8\telse static if (is(typeof(fn(%s)))) 
     9\t\tconst uint minArgs = %s;""" 
    1010 
    11 for i in range(1, 11): 
     11for i in range(21): 
    1212    args = [] 
    1313    for j in range(i): 
    14         args.append(arg_template % (j+1,)) 
     14        args.append(arg_template % (j,)) 
    1515    print template % (", ".join(args), i) 
     16 
     17sys.stdout = old_stdout 
     18 
  • trunk/infrastructure/pyd/generators/min_args.txt

    r26 r40  
    1     else static if (is(typeof(fn(ArgType!(fn_t, 1).init)))) 
    2         const uint MIN_ARGS = 1; 
    3     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init)))) 
    4         const uint MIN_ARGS = 2; 
    5     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init, ArgType!(fn_t, 3).init)))) 
    6         const uint MIN_ARGS = 3; 
    7     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init, ArgType!(fn_t, 3).init, ArgType!(fn_t, 4).init)))) 
    8         const uint MIN_ARGS = 4; 
    9     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init, ArgType!(fn_t, 3).init, ArgType!(fn_t, 4).init, ArgType!(fn_t, 5).init)))) 
    10         const uint MIN_ARGS = 5; 
    11     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init, ArgType!(fn_t, 3).init, ArgType!(fn_t, 4).init, ArgType!(fn_t, 5).init, ArgType!(fn_t, 6).init)))) 
    12         const uint MIN_ARGS = 6; 
    13     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init, ArgType!(fn_t, 3).init, ArgType!(fn_t, 4).init, ArgType!(fn_t, 5).init, ArgType!(fn_t, 6).init, ArgType!(fn_t, 7).init)))) 
    14         const uint MIN_ARGS = 7; 
    15     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init, ArgType!(fn_t, 3).init, ArgType!(fn_t, 4).init, ArgType!(fn_t, 5).init, ArgType!(fn_t, 6).init, ArgType!(fn_t, 7).init, ArgType!(fn_t, 8).init)))) 
    16         const uint MIN_ARGS = 8; 
    17     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init, ArgType!(fn_t, 3).init, ArgType!(fn_t, 4).init, ArgType!(fn_t, 5).init, ArgType!(fn_t, 6).init, ArgType!(fn_t, 7).init, ArgType!(fn_t, 8).init, ArgType!(fn_t, 9).init)))) 
    18         const uint MIN_ARGS = 9; 
    19     else static if (is(typeof(fn(ArgType!(fn_t, 1).init, ArgType!(fn_t, 2).init, ArgType!(fn_t, 3).init, ArgType!(fn_t, 4).init, ArgType!(fn_t, 5).init, ArgType!(fn_t, 6).init, ArgType!(fn_t, 7).init, ArgType!(fn_t, 8).init, ArgType!(fn_t, 9).init, ArgType!(fn_t, 10).init)))) 
    20         const uint MIN_ARGS = 10; 
     1    else static if (is(typeof(fn()))) 
     2        const uint minArgs = 0; 
     3    else static if (is(typeof(fn(I!(0)())))) 
     4        const uint minArgs = 1; 
     5    else static if (is(typeof(fn(I!(0)(), I!(1)())))) 
     6        const uint minArgs = 2; 
     7    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)())))) 
     8        const uint minArgs = 3; 
     9    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)())))) 
     10        const uint minArgs = 4; 
     11    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)())))) 
     12        const uint minArgs = 5; 
     13    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)())))) 
     14        const uint minArgs = 6; 
     15    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)())))) 
     16        const uint minArgs = 7; 
     17    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)())))) 
     18        const uint minArgs = 8; 
     19    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)())))) 
     20        const uint minArgs = 9; 
     21    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)())))) 
     22        const uint minArgs = 10; 
     23    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)())))) 
     24        const uint minArgs = 11; 
     25    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)())))) 
     26        const uint minArgs = 12; 
     27    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)(), I!(12)())))) 
     28        const uint minArgs = 13; 
     29    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)(), I!(12)(), I!(13)())))) 
     30        const uint minArgs = 14; 
     31    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)(), I!(12)(), I!(13)(), I!(14)())))) 
     32        const uint minArgs = 15; 
     33    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)(), I!(12)(), I!(13)(), I!(14)(), I!(15)())))) 
     34        const uint minArgs = 16; 
     35    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)(), I!(12)(), I!(13)(), I!(14)(), I!(15)(), I!(16)())))) 
     36        const uint minArgs = 17; 
     37    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)(), I!(12)(), I!(13)(), I!(14)(), I!(15)(), I!(16)(), I!(17)())))) 
     38        const uint minArgs = 18; 
     39    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)(), I!(12)(), I!(13)(), I!(14)(), I!(15)(), I!(16)(), I!(17)(), I!(18)())))) 
     40        const uint minArgs = 19; 
     41    else static if (is(typeof(fn(I!(0)(), I!(1)(), I!(2)(), I!(3)(), I!(4)(), I!(5)(), I!(6)(), I!(7)(), I!(8)(), I!(9)(), I!(10)(), I!(11)(), I!(12)(), I!(13)(), I!(14)(), I!(15)(), I!(16)(), I!(17)(), I!(18)(), I!(19)())))) 
     42        const uint minArgs = 20;