change mixins

Adam D. Ruppe destructionator at gmail.com
Sun Feb 14 13:44:51 PST 2010


On Sun, Feb 14, 2010 at 01:31:29PM -0800, Walter Bright wrote:
> The proposal is to switch it around:
> 
>    mixin template foo(T) { declarations... }
> 
>    foo!(int) handle;

What about:

template foo() { int a; }

mixin foo!();
a = 0;

? Will the change still let you use the mixed in template without a name?

It would look a little weird:

struct A {
	foo!();
}


> What do you think?

I'm on the fence. The difference seems to me that it applies in both
places - definition and use. Maybe the mixin keyword should be required
in both places?

-- 
Adam D. Ruppe
http://arsdnet.net



More information about the Digitalmars-d mailing list