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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d89e2d213646aec8 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!wn13feed!worldnet.att.net!12.120.4.37!attcg2!ip.att.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Mneson announcement and help request Date: 4 Jun 2004 08:11:25 -0600 Organization: LJK Software Message-ID: References: <-NSdneXjh7wndyLdRVn-vw@megapath.net> <2f8p9c.0p5.ln@skymaster> NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1086354602 21316 192.135.80.34 (4 Jun 2004 13:10:02 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Fri, 4 Jun 2004 13:10:02 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:1095 Date: 2004-06-04T08:11:25-06:00 List-Id: In article <2f8p9c.0p5.ln@skymaster>, "Jean-Pierre Rosen" writes: > >> "Randy Brukardt" wrote in message >> news:-NSdneXjh7wndyLdRVn-vw@megapath.net... >> > My point was that as long as you keep the exception handler and raising >> out >> > of the loop (which is certainly true for EOF), it can be quite efficient. >> In >> > the normal case (where you read many characters before reaching the end of >> > the file), it's almost always better to handle the exception. That's >> because >> > one exception raise/handling pair is a lot cheaper than 10,000 function >> > calls, especially one as expensive as EOF. > > I always use the exception mechanism for another reason: > In the presence of a "malformed" file (i.e. one where the last line has no line terminator before EOF), you may have an unexpected > End_Error even if End_Of_File was false. Of course, this is outside Ada semantics, but it's the real world that text files are > sometimes being typed by human beings.... That seems to be restricted to operating systems where the file system does not handle record semantics.