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

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.

I'm not even sure that this is necessarily a good thing for the
programmer. A syntax error may end up in a semantic error. For
instance, the programmer wants to write "[2.1]" (which has the
same value as "[2.1,2.1]"), but uses the European decimal separator
by mistake: "[2,1]". He would get a semantic error, while the
actual error was a syntax one. In fact, the worse is that not all
such errors can be detected, e.g. if the programmer writes "[2,3]"
instead of "[2.3]".

-- 
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)