About std.ascii.toLower

monarch_dodra monarchdodra at gmail.com
Fri Sep 21 05:10:25 PDT 2012


On Friday, 21 September 2012 at 11:25:54 UTC, Jonathan M Davis 
wrote:
> 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

I know my ideas usually get shot down, but I usually learn a LOT 
from your answers, so sorry for insisting.

I did not know conv's to did cast validation. In my defense, the 
doc is actually missing:

http://dlang.org/phobos/std_conv.html

I made a doc pull request so that it would appear.

https://github.com/D-Programming-Language/phobos/pull/811


More information about the Digitalmars-d-learn mailing list