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,a0833bbed8752e1f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!proxad.net!proxad.net!oleane.net!oleane!skymaster!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: variable lenght strings Date: Tue, 26 Oct 2004 10:43:37 +0200 Organization: Adalog Message-ID: References: <1861614.TWv5A9FgVL@linux1.krischik.com> <4178e979_1@baen1673807.greenlnk.net> <1195374.UMjBCk7lO1@linux1.krischik.com> <1154613.ipZcUgduzp@linux1.krischik.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: s5.feed.news.oleane.net 1098781736 8076 195.25.228.57 (26 Oct 2004 09:08:56 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 26 Oct 2004 09:08:56 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.2) Gecko/20040803 X-Accept-Language: fr-fr, en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:5713 Date: 2004-10-26T10:43:37+02:00 List-Id: Randy Brukardt a =E9crit : > My opinion is that GNAT is wrong in that case. A.10(7) makes it quite c= lear > that you can't have a file terminator without a line and page terminato= r in > front of it. More precisely: a file that doesn't end with a line/page terminator is=20 improperly formatted. >=20 > I vaguely recall having argued this with Robert Dewar, and I think that= they > had a different interpretation, based on the idea that a file with a mi= ssing > CR/LF is incorrect for use with Text_IO. I hope I misremember that, bec= ause > it is stupid (even if it is logically correct) as it essentially says t= hat > you can't read outside generated text files with Text_IO (you can't kno= w > whether the file has CR/LFs as required). >=20 > But I can understand why they wouldn't want to do this properly, becaus= e it > is a pain to get right, and it saps the performance of Text_IO (since y= ou > have the be prepared to check for implied characters for each one you r= ead). No, it's simpler than that. In all my programs, I simply never check for End_Of_File, I catch=20 End_Error instead. It is simpler in other cases too: if you read=20 numbers, and the file is terminated with blank lines, you can get=20 End_Error even when End_Of_File is false. --=20 --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr