On 02/06/2010 05:55 AM, Joel Anderson wrote:
On 2/4/2010 4:41 PM, Trip Volpe wrote:
Joel Anderson Wrote:

That's one of the reasons I've wished D had a nicer syntax for the
string mixin format. This one kinda scares people away :p


What kind of syntax do you have in mind?

Making mixins less obtrusive might ease aggravation when they're being
used as boilerplate, but making it harder to see when they're being
used might have downsides as well. :-P

Not sure. I'm sure there's a syntax that could meet both goals.
Something like.

void expectsEquals(string data)()
{
mixin(data);
}

...

expectsEquals!("myFoo == 3")();

or

expectsEquals!("myFoo == 3");


This syntax should be possible, which also gives syntax highlighting:

expectEquals!q{ myFoo == 3 };

But there is the problem that expectEquals is defined in a module which doesn't have access to myFoo. I don't know how to solve that.




Reply via email to