Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Let's Go! Super D Wish Dream Taimu Desu~

Name: Anonymous 2012-02-07 11:49

Didn't see a D thread. Let's get this shit going!

Using a template mixin to simulate multiple inheritance:

template mixin Parent1
{
    public
    {
        void writeMsg1()
        {
            writeln("Hey proggit!");
        }
    }
}

template mixin Parent2
{
    public
    {
        void writeMsg2()
        {
            writeln("Why haven't you learned D yet?");
        }
    }
}

class Child
{
    mixin parent1;
    mixin parent2;
}

At compile time, Child is expand to this:
class Child
{
    public
    {
        void writeMsg1()
        {
            writeln("Hey proggit!");
        }
    }

    public
    {
        void writeMsg1()
        {
            writeln("Why haven't you learned D yet?");
        }
    }
}

You can now create an instance of Child and call it's two member functions, writeMsg1 and writeMsg2. It's that simple!

Name: Anonymous 2012-02-07 11:55

D is fucking shit.

Name: Anonymous 2012-02-07 12:19

>>2
You, sir, are fucking shit

Name: kodak_gallery_programmer !!qmiXqQhekkGXVVD 2012-02-07 13:03

Oh geeze. That's horrible. Man, I tell ya, I think my IQ dropped by 20 points after reading that crap.

Name: Anonymous 2012-02-07 13:07

>>4
Guess you must really like single inheritance and 90% of your code being useless boilerplate. Have fun with your minimum wage Java career.

Name: Anonymous 2012-02-07 13:39

>>5
Don't be j.

Name: Anonymous 2012-02-07 13:46

>>6
'>Implying I am j'

Name: Anonymous 2012-02-07 13:54

>>1
nice

Name: Anonymous 2012-02-07 16:00

D IS GAY
C# IS GAY
JAVA IS GAY

NOW EVERYONE SHUT THE FUCK UP

Don't change these.
Name: Email:
Entire Thread Thread List