D vs Go in real life

Walter Bright newshound2 at digitalmars.com
Sat Nov 30 10:16:25 PST 2013


On 11/29/2013 12:29 AM, Bienlein wrote:
> I guess in D you would do something like this:
>
> mixin template Rectangular() {
>    Point x, y;
> }
>
> mixin Rectangular;
>
> struct Rectangle {
>    mixin Rectangular;
> }

It's easier than that:

struct Rectangular {
     Point x,y;
}

struct Rectangular {
     Rectangle rectangle;
     alias this rectangle;
}



More information about the Digitalmars-d mailing list