About std.ascii.toLower

Jonathan M Davis jmdavisProg at gmx.com
Fri Sep 21 04:26:38 PDT 2012


On Friday, September 21, 2012 13:18:01 monarch_dodra wrote:
> Related, could "toChar" be considered for inclusion? I think it
> would be a convenient tool for validation.

I certainly would be against adding it. I think that it's a relatively 
uncommon use case and considering how easy it is to just write the function 
yourself, the functionality gain is minimal. I just don't think that it 
carries it's weight as far as the standard library goes. But I don't know how 
others like Andrei would feel.

> That said, if we go that way, we might as well just have a more
> generic safeCast in std.conv or something:

You're basically asking for a version of std.conv.to which uses assertions 
instead of exceptions.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list