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

           Summary: Add support for different base conversions in std.conv
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2011-07-05 
14:58:40 PDT ---
This doesn't work currently:
to!int("0xFF");

Python's int() function solves this by taking an optional base argument:
http://docs.python.org/library/functions.html#int

So it can be called like:
clr = int("0000FF", 16)

I've seen this used in some functions which convert web colors to an integer.

So std.conv could take an optional base argument or maybe try to parse the
string and figure out if it's hexadecimal (since this is probably the most
commonly used base after base-10).

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

Reply via email to