http://d.puremagic.com/issues/show_bug.cgi?id=4527

           Summary: writeln/typeid to use string type names
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-07-28 14:58:21 PDT ---
This is a D2 program:

import std.stdio: writeln;
void main() {
    writeln(typeid(string));
    writeln(typeid(wstring));
    writeln(typeid(dstring));
}


I'd like the output of that program to be:

string
wstring
dstring

Instead of (dmd 2.047):

immutable(char)[]
immutable(wchar)[]
immutable(dchar)[]


"immutable(dchar)[]" is less readable, and dstring is a standard built-in alias
in D2.

Making them readable is especially important when string types are inside more
complex types, to decrease the visual noise a lot. Example:

import std.stdio;
void main() {
    wstring[string[dstring]] a;
    writeln(typeid(typeof(a)));
}

Prints an unreadable:
immutable(wchar)[][const(immutable(char)[])[immutable(dchar)[]]]

While this is almost readable still:
wstring[string[dstring]]


See also bug 3086

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to