December 18, 2002 Request | ||||
---|---|---|---|---|
| ||||
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 Re: Request | ||||
---|---|---|---|---|
| ||||
Posted in reply to anderson | 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
|
Copyright © 1999-2021 by the D Language Foundation