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 Path: g2news2.google.com!news4.google.com!newshub.sdsu.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Get_Line problem (GNAT bug?) Date: Thu, 07 Dec 2006 10:14:05 +0100 Organization: Adalog Message-ID: <31m8le.012.ln@hunter.axlog.fr> References: <1c1gbc5u9cpvp.1wj1zhhn7q86j$.dlg@40tude.net> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1165485965 1332 195.25.228.57 (7 Dec 2006 10:06:05 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 7 Dec 2006 10:06:05 +0000 (UTC) User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: <1c1gbc5u9cpvp.1wj1zhhn7q86j$.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:7846 Date: 2006-12-07T10:14:05+01:00 List-Id: Dmitry A. Kazakov a �crit : > The rules of thumb I suppose I and many other Ada programmers are using: > > 1. Never ever use End_Of_File with text files; > 2. If you yet use End_Of_File then do it for *each* character of the file; > 3. As Adam has suggested, End_Error exception is the right design; > 4. End_Error is not only cleaner and correct, but also more efficient. > And I'll add another one: 5. End_Error works correctly with badly formed files, i.e. files whose last line does not end with and end-of-line mark. You can get strange behaviour in that case with any other solution. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr