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

Re: textToIntevsal(s) and exceptions



Indeed.  However, I'm not certain we can protect the programmer
from all possible errors.  If someone is determined to shoot
himself in the foot, it may not be possible in all cases to
prevent him from doing so.

I am just hoping the standard makes it clear how a standard-conforming
system will behave, given particular inputs.  In that case, the
programmer can refer to the standard for development and debugging
purposes.

Baker

P.S. It is too bad the "decimal point" and "decimal comma" aren't standardized.

On 03/16/2015 10:17 AM, Vincent Lefevre wrote:
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]".



--

---------------------------------------------------------------
Ralph Baker Kearfott,   rbk@xxxxxxxxxxxxx   (337) 482-5346 (fax)
(337) 482-5270 (work)                     (337) 993-1827 (home)
URL: http://interval.louisiana.edu/kearfott.html
Department of Mathematics, University of Louisiana at Lafayette
(Room 217 Maxim D. Doucet Hall, 1403 Johnston Street)
Box 4-1010, Lafayette, LA 70504-1010, USA
---------------------------------------------------------------