DMD 1.005 release
Tomas Lindquist Olsen
tomas at famolsen.dk
Mon Feb 12 09:32:29 PST 2007
Walter Bright wrote:
> Bruno Medeiros wrote:
>> Walter Bright wrote:
>>> Bruno Medeiros wrote:
>>>> Well, actually you can do that, with the unannounced (in the
>>>> changelog) .stringof property (
>>>> http://www.digitalmars.com/d/property.html ) :
>>>>
>>>> ----
>>>>
>>>> template MakeVariable(Type, char[] name)
>>>> {
>>>> const char[] MakeVariable = Type.stringof ~ " " ~ name ~ ";";
>>>> }
>>>
>>> It's unannounced because it doesn't work right yet.
>>
>> What do you mean? If it's doesn't work right yet, why was it released
>> already? (basic cases seem to be working)
>
> It doesn't hurt anything to be there.
Is there any chance we could have alias template parameters become more
generic in 1.0006 ? together with stringof, the new mixins could become
very powerful...
with much nicer syntax.
template Add(alias L, alias R)
{
const Add = L.stringof ~ " + " ~ R.stringof;
}
right now this template only works when the parameters are single symbols.
would be nice be be able to do:
Add!(42,foo);
Add!(foo+bar,foo-bar);
etc...
More information about the Digitalmars-d-announce
mailing list