From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5afe598156615c8b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Thu, 07 Dec 2006 07:34:35 -0600 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Get_Line problem (GNAT bug?) References: <1c1gbc5u9cpvp.1wj1zhhn7q86j$.dlg@40tude.net> <7fm8le.pa5.ln@hunter.axlog.fr> Date: Thu, 07 Dec 2006 14:35:06 +0100 Message-ID: <873b7rde2d.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:C95rCv9lU/t6FTXc462E4dvSsQE= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 62.235.242.15 X-Trace: sv3-Q6vmZTMqZy3ujbNuuQmNAYEUjmb+JY0GBh1/onyrW8Do2S4xhaxCzxcBYvpDHmGyWabVcePj/OlAypK!hyK8i8sXzPrRcOpB6psqlQorNtYSPMqPVe84l8oSzRABNTv0W2mus00zkTFNIKB938raauBcgw== X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:7850 Date: 2006-12-07T14:35:06+01:00 List-Id: Jean-Pierre Rosen writes: > I beg to differ. Otherwise, they would be called "errors" or "abnormal". > An exception corresponds to an "exceptional" event, i.e. something > that prevents usual processing, and forces you to an exceptional > handling. If you consider that normal processing (normally the body of > a loop) is the rule, it is an exception to the rule. And EOF certainly > matches this definition (as is an error, of course, but it is not the > only case). > > Exceptions are a useful tool in the programmers tool box. The narrow > view of exceptions as just a way to handle errors is a mistake that > prevents elegant solutions to some problems, in my view, and I've been > constantly fighting against that. I agree with you in the general case where you have an Ada run-time library that propagates exceptions. But there are cases where your Ada run-time library does not propagate exceptions, or where you don't have a run-time library at all. In those particular cases, you have to use the "narrow view" whereby an exception is something so exceptional that it "should never happen" (tm). In the OP's case, handling EOF as an exception is just fine, since file I/O implies the existence of a suitable run-time library. -- Ludovic Brenta.