DIP76: Autodecode Should Not Throw

via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 7 03:13:55 PDT 2015


On Tuesday, 7 April 2015 at 09:21:52 UTC, Walter Bright wrote:
> On 4/7/2015 2:10 AM, Vladimir Panteleev wrote:
>> On Tuesday, 7 April 2015 at 09:04:09 UTC, Walter Bright wrote:
>>> On 4/7/2015 1:19 AM, Dicebot wrote:
>>>> I have doubts about it similar to Vladimir. Main problem is 
>>>> that I have no idea
>>>> what actually happens if replacement characters appear in 
>>>> some unicode text my
>>>> program processes.
>>>
>>> It's much like floating point NaN values, which are 'sticky'.
>>
>> Yes, but std.conv doesn't return NaN if you try to convert 
>> "banana" to a double.
>
> Maybe it should :-)

There was a time when operations on NaNs where painfully slow. 
Also, since NaNs tend to spread, once a NaN appears, there usual 
is not much of a result left. Debugging used to be painfully hard 
if NaNs are enabled. We used to rely on floating point exceptions 
instead.

This might or might not be relevant.


More information about the Digitalmars-d mailing list