The Final(ize) Challenge

Jarrett Billingsley jarrett.billingsley at gmail.com
Mon May 18 11:42:17 PDT 2009


On Mon, May 18, 2009 at 2:34 PM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:

> I think you need to operate exclusively with string mixins in Finalize, so
> __ident would be of marginal help there. Also, static foreach is much more
> necessary.

I have used string mixins extensively in my own code, not just in this
one example.  Most of the time it's to replace a name.  With something
like __ident, I wouldn't have to use them nearly as much, and in fact
I probably wouldn't need them here.  Think about it:

template CreateOverload(alias func, char[] name)
{
	ReturnType!(func) __ident(name)(ParameterTypeTuple!(func) args)
	{
		return super.__ident(name)(args);
	}
}

Then later, I could just use a template mixin.

You say static foreach is much more necessary than this.  Why?  It's
just a convenience, so you don't have to use template recursion.  Is
it more important because you want to use it?



More information about the Digitalmars-d mailing list