TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Randy Brukardt <[log in to unmask]>
Sun, 15 Aug 1999 20:41:14 -0500
text/plain (18 lines)
> > Why is it that user-defined exceptions are treated in a different manner
> > from the pre-defined ones?  What happens to the <LT> character (which I
> > assume to be remaining in the buffer and causing the loop) in the
> > Range_Error situation?
> Try entering eg 1 0 1 x x x RET:

Ada.Text_IO.Get is defined to read only legal characters; if it raises an
exception it reads NOTHING. Therefore, the illegal characters remain in the
input stream; if you do the same read again, you'll get the same error
(because the same characters are still there).

This behavior was defined in Ada 83, and Ada 95 left it alone for
compatibility purposes. This is the number one not-a-bug bug report that we
get here at RRS, and I wish it had been defined more intuitively...