www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13020] New: std.ascii.isASCII for strings too or nogc

https://issues.dlang.org/show_bug.cgi?id=13020

          Issue ID: 13020
           Summary: std.ascii.isASCII for strings too or  nogc all!isASCII
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

In std.ascii there is the function:

pure nothrow  safe bool isASCII(dchar c);

I suggest to add an isASCII overload that works on whole strings too (note that
it's  nogc too):

bool isASCII(in string s) pure nothrow  safe  nogc;

Currently you can write:

s.all!isASCII

But this is not  nogc.

An alternative solution is to make "all!isASCII"  nogc.

--
Jul 02 2014