--- Comment #4 from Jonathan M Davis <> 2012-07-13 13:59:09 
PDT ---
format and writeln are supposed to behave the same, because they both operate
on format strings (they _don't_ currently behave 100% the same, but format's
current implementation will be replaced with the new xformat's implementation
in a few months - after the "scheduled for deprecation" time period). to!string
is an entirely different beast. is asking for an explicit conversion to string, whereas format and
writeln are converting according to the format specifiers, and %s indicates the
default string representation of the type. char*, wchar*, and dchar* are
pointers - _not_ strings - and should not be treated as strings. Pointers print
their address with %s. Making char*, wchar*, and dchar* print themselves as
strings would be inconsistent with other pointer types, and operating on char*,
wchar*, and dchar* should be discouraged, not encouraged.

to!string is treated differently, because you're asking for an explicit
conversion, and we _do_ need to be able to convert null-terminated strings to D

So, while I can see your point, I really don't think that having format or
writeln treat char*, wchar*, or dchar* as null-terminated strings is a good
idea. We should provide a means of converting them to D strings but not do
anything to encourage using them as-is without converting them.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to