public static void Run() { Lit one = new Lit(1); Add <Lit, Lit> oneplusone = new Add <Lit, Lit>(one, one); int two = Eval <EvalAdd <EvalLit, EvalLit, Lit, Lit>, Add <Lit, Lit> >(oneplusone); Console.Write("Print(\"1+1\")=\""); Overloads.Print <PrintAdd <PrintLit, PrintLit, Lit, Lit>, Add <Lit, Lit> >(oneplusone); Console.WriteLine("\""); Console.WriteLine("Eval(\"1+1\")={0}", two); }
public void print(Add <X, Y> a) { Overloads.Print <PrintX, X>(a.x); Console.Write("+"); Overloads.Print <PrintY, Y>(a.y); }