Re: A thought for template alias parameters?

2010-02-14 Thread Trip Volpe
Lutger Wrote: > > 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. > Template alias parameters han

Re: A thought for template alias parameters?

2010-02-06 Thread Lutger
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

Re: A thought for template alias parameters?

2010-02-05 Thread Joel Anderson
On 2/5/2010 8:55 PM, 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 obt

Re: A thought for template alias parameters?

2010-02-05 Thread Joel Anderson
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

Re: A thought for template alias parameters?

2010-02-04 Thread Trip Volpe
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 mak

Re: A thought for template alias parameters?

2010-02-03 Thread Joel Anderson
On 2/3/2010 10:27 PM, Trip Volpe wrote: Joel Anderson Wrote: You could potentially use a mixin to do this. The resulting code would look something like this. void main() { int myFoo = 100; mixin(expectEquals! ( "myFoo == 3" )); } Yeah, mixins could work, but they're

Re: A thought for template alias parameters?

2010-02-03 Thread Trip Volpe
Joel Anderson Wrote: > > You could potentially use a mixin to do this. The resulting code would > look something like this. > > void main() > { >int myFoo = 100; >mixin(expectEquals! ( "myFoo == 3" )); > } Yeah, mixins could work, but they're ugly. ;-) Forcing the use

Re: A thought for template alias parameters?

2010-02-03 Thread Joel Anderson
On 2/3/2010 9:34 PM, Trip Volpe wrote: I'm working on a set of handy unit testing accessories for my projects. What I'd love to achieve is something like this: expectEqual( myFoo, 3 ); Which, on failure, would result in something along the lines of this diagnostic: somefile.d:37: Tes

A thought for template alias parameters?

2010-02-03 Thread Trip Volpe
I'm working on a set of handy unit testing accessories for my projects. What I'd love to achieve is something like this: expectEqual( myFoo, 3 ); Which, on failure, would result in something along the lines of this diagnostic: somefile.d:37: Test failure! Expected: myFoo == 3