www.digitalmars.com         C & C++   DMDScript  

D - Request

reply "anderson" <anderson firestar.com.au> writes:
I don't know if something like this has already been implemented in D.

What about a flag from printf that will output a datatype in it's right
format. Or perhaps a function that will convert any datatype to a string.

ie

printf("%a", value);

or

printf("%.*s", tosting(value));

Personally I'd prefer version 1.
Dec 18 2002
parent Evan McClanahan <evan dontSPAMaltarinteractive.com> writes:
anderson wrote:
 I don't know if something like this has already been implemented in D.
 
 What about a flag from printf that will output a datatype in it's right
 format. Or perhaps a function that will convert any datatype to a string.
 
 ie
 
 printf("%a", value);
 
 or
 
 printf("%.*s", tosting(value));
 
 Personally I'd prefer version 1.

I think that a flag like that might need to wait on better classinfo and typeinfo stuff, but it's a great idea, no doubt. Evan
Dec 18 2002