TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

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

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

Print Reply
Subject:
From:
Randy Brukardt <[log in to unmask]>
Reply To:
Randy Brukardt <[log in to unmask]>
Date:
Sun, 15 Aug 1999 20:41:14 -0500
Content-Type:
text/plain
Parts/Attachments:
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...

                        Randy.

ATOM RSS1 RSS2