On Wed, Mar 31, 2010 at 09:03:10PM +0200, Philippe Sigaud wrote: > Cool, I wasn't sure it'd work. Now we know what this new trait is for :)
It is slightly different than my old code: the getPlainName helper function is not required with the __trait. (It truncated the string at the first paren, since stringof returns the arguments too, whereas identifier does not). I think it would be a good idea to get a nice overview doc written up on template idioms - things like this, how to use the isSomeString, etc, templates in std.traits to work the constraints, and so on. Another one in pretty.d I hit was taking a ParameterTypeTuple and using it to expand the runtime args array. At first, I used a list of static if T.length == 1, and manually written it out. Today, I changed it to a CTFE function returning a string to mix on, which sucks less, but still feels weird. Having a nice overview document would be good to save time and make this kind of code prettier. Maybe I'll write one to get started then post it to the group for additions and improvements. Don't have the time today though. -- Adam D. Ruppe http://arsdnet.net