December 18, 2002
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.


December 18, 2002
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