Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Exceptions vs NaN/NaI



P1788

On 18 Apr 2012, at 13:40, Vincent Lefevre wrote:
> Dmitry wrote:
>> There are a few common ways to signal a failure in programming anguages:
>> 1) Set a global/thread-local flag like "errno";
>> 2) Return specifal value like NaI or NaN;
>> 3) Throw a language exception (like in C++ or in Java).
>> 
>> As far as I understand, the draft of the standard recommends(requires) (2).
...
>> However, shouldn't the P1788 be flexible enough to allow
>> both level 2 operations that signal by (2)
>> and  level 2 operations that signal by (3) ?
> 
> I think that (2) should be mandatory, but (3) can be allowed if
> the user requests it ((3) is not possible in all languages).

Surely (3) is *allowed* as long as the standard doesn't forbid it, which I see no reason to do. Are you suggesting the standard should do something stronger than *allow*, e.g. *recommend* that implementations provide (3)?

John P