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,CP1252 X-Google-Thread: 103376,386228a37afe967f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-16 11:01:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F15930C.2070907@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Computer Language Shootout References: <1ec946d1.0307150715.4ba69f85@posting.google.com> <3F149243.80304@attbi.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 66.31.71.243 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc51.ops.asp.att.net 1058378509 66.31.71.243 (Wed, 16 Jul 2003 18:01:49 GMT) NNTP-Posting-Date: Wed, 16 Jul 2003 18:01:49 GMT Organization: Comcast Online Date: Wed, 16 Jul 2003 18:01:49 GMT Xref: archiver1.google.com comp.lang.ada:40348 Date: 2003-07-16T18:01:49+00:00 List-Id: Matthew Heaney wrote: > Do you really mean that End_Of_File and Get_Line use Current_Output? I > thought they used Current_Input. Oops! That's what I get for posting after midnight. > Aside: I don't ever use End_Of_Line, since the locution > > if Last < Line'Last then > > conveys all the information I need wrt whether the entire line has been > consumed. What is End_Of_Line buying me that the idiom above does not? Has the actual end of line been consumed? If the line is the same length as your buffer, the Get_Line can read exactly Last characters but still be positioned at the end of line. In one case, you will be left at the end of line, and in the other you won't. The orginal code you posted for word count has disappeared from the Newsgroup server I use, so I am commenting in general. Sometimes you need to check that you have consumed all the characters, sometimes you need to check that you are at end of line, and in some cases both checks are needed. In this case I think you can read and count a bogus line if the input line is exactly 133 characters long. The first read will get all 133 characters, the second will get no characters and the new line. -- Robert I. Eachus �In an ally, considerations of house, clan, planet, race are insignificant beside two prime questions, which are: 1. Can he shoot? 2. Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and Steve Miller.