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,386228a37afe967f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-16 14:35:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Computer Language Shootout Date: 16 Jul 2003 14:35:58 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0307161335.72dd51b1@posting.google.com> References: <1ec946d1.0307150715.4ba69f85@posting.google.com> <3F149243.80304@attbi.com> <3F15930C.2070907@attbi.com> NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1058391358 17751 127.0.0.1 (16 Jul 2003 21:35:58 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 16 Jul 2003 21:35:58 GMT Xref: archiver1.google.com comp.lang.ada:40359 Date: 2003-07-16T21:35:58+00:00 List-Id: "Robert I. Eachus" wrote in message news:<3F15930C.2070907@attbi.com>... > > 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. Yes. That's AI-50 behavior. > 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. The code I posted will work even in this case, because it doesn't adjust the line count unless it has read the newline (which is indicated by Last < Line'Last).