예제 #1
0
 public static same_func <R> bind <R, P1, T1>(func_res <R, P1> handler, T1 p1)
 {
     return(delegate(object[] args)
     {
         return handler((P1)(functional._ == (object)p1 ? args[0] : p1));
     });
 }
예제 #2
0
 public static same_func <R> bind <R, P1, P2, T1, T2>(func_res <R, P1, P2> handler, T1 p1, T2 p2)
 {
     return(delegate(object[] args)
     {
         int i = 0;
         return handler((P1)(functional._ == (object)p1 ? args[i++] : p1),
                        (P2)(functional._ == (object)p2 ? args[i++] : p2));
     });
 }
예제 #3
0
 public static same_func <R> cast <R, T1>(func_res <R, T1> handler)
 {
     return((object[] args) => handler((T1)args[0]));
 }
예제 #4
0
 public static same_func <R> cast <R, T1, T2, T3>(func_res <R, T1, T2, T3> handler)
 {
     return((object[] args) => handler((T1)args[0], (T2)args[1], (T3)args[2]));
 }
예제 #5
0
 public static same_func <R> cast <R>(func_res <R> handler)
 {
     return((object[] args) => handler());
 }