"Hiding" the mixin keyword?

renoX renosky at free.fr
Fri Feb 23 13:49:44 PST 2007


Hello,

I implemented a format string template, but my problem is that calling 
it looks like this:
mixin(putf!("Should be 31: %d{x+y+1}\n"));

Here's putf definition:
template putf(A...)
{
	const char[] putf = "writef(" ~ Fmt!(A) ~ ");";
	//static pragma(msg, "putf result is'"~putf~"'");
}
Fmt being the template which does the real work of parsing the format 
string.

What I would like is a way to 'hide' the mixin keyword, is-it possible 
to put into the template so that the result would look like:
putf!("Should be 31: %d{x+y+1}\n"); ?

Maybe with a static wrapper function?
Or is-it impossible?

All my trials failed so far..

Thanks for your help,
renoX


More information about the Digitalmars-d-learn mailing list