www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

D - Request

↑ ↓ ← "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
↑ ↓ → 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