Re: textToIntevsal(s) and exceptions
On 2015-03-16 07:51:51 -0700, Dmitry Nadezhin wrote:
> However, I (as programmer) think that it would be useful if
> syntax error is signalled by one exception and semantic error (l > u) is
> signalled by another exception. So I asked this question to the group
> because it seemed to me that we overlooked this.
Note that InvalidOperand does not correspond to a syntax error, but
to an internal encoding error. IMHO, the same UndefinedOperation
exception is fine for both syntax and semantic errors. Since such an
exception is language- or implementation-defined, the implementation
could provide information on the error itself: the kind of the error,
the position in the string where the error was detected, and so on.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)