www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9558] New: 0b and 0x prefixes for std.string.isNumeric

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

           Summary: 0b and 0x prefixes for std.string.isNumeric
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-02-21 09:52:31 PST ---
This is almost an enhancement request.

I think std.string.isNumeric should see the 0b and 0x prefixes as parts of a
number literal:


import std.stdio: writeln;
import std.string: isNumeric;
void main() {
    isNumeric("0x10").writeln();
    isNumeric("0b1010101").writeln();
}


With dmd 2.062 prints:

false
false


Expected:

true
true

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