Example #1
0
        static void Main(string[] args)
        {
            Test <int> test1 = new Test <int>(5);

            test1.Write();

            Test <string> test2 = new Test <string>("Hello World!");

            test2.Write();

            List <bool>   list1 = GetInitializedList(true, 5);
            List <string> list2 = GetInitializedList("Perls", 3);

            foreach (bool value in list1)
            {
                Test <bool> test = new Test <bool>(value);
                test.Write();
            }
            foreach (string value in list2)
            {
                Test <string> test = new Test <string>(value);
                test.Write();
            }

            Perl <Program> perl = new Perl <Program>();

            add <int> sum = AddNumber;

            new Test <int>(sum(10, 20)).Write();

            add <string> conct = Concate;

            new Test <string>(conct("Hello", "World!!")).Write();
        }
Example #2
0
 static void Main()
 {
     // DataTable implements IDisposable so it can be used with Ruby.
     Ruby <DataTable> ruby = new Ruby <DataTable>();
     // Int is a struct (ValueType) so it can be used with Python.
     Python <int> python = new Python <int>();
     // Program is a class with a parameterless constructor (implicit)
     // ... so it can be used with Perl.
     Perl <Program> perl = new Perl <Program>();
 }
    static void Main()
    {
        Perl perl = new Perl(1, 2);

        Console.WriteLine(perl);
    }
Example #4
0
 static void Main(string[] args)
 {
     Ruby <DataTable> ruby   = new Ruby <DataTable>();
     Python <int>     python = new Python <int>();   // Как выяснилось, int - это struct....
     Perl <Program>   perl   = new Perl <Program>(); //Тип, как отдельно взятый класс...? Прикольно. Ок.
 }