comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: What's the cause of extra new line with Text_IO when program exit
Date: Mon, 19 Aug 2013 16:58:34 -0500
Date: 2013-08-19T16:58:34-05:00	[thread overview]
Message-ID: <kuu4eb$l4s$1@loke.gir.dk> (raw)
In-Reply-To: c5ev09h1d6ffg0bbgtqebl4fjt5d567bco@4ax.com

"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message 
news:c5ev09h1d6ffg0bbgtqebl4fjt5d567bco@4ax.com...
> On Thu, 15 Aug 2013 20:17:46 -0700, Jeffrey Carter
> <spam.jrcarter.not@spam.not.acm.org> declaimed the following:
>
>>While it is not defined by the language what happens to a File_Type when 
>>the
>>program ends [ARM A.7(6)], it does require that File_Type have 
>>finalization [ARM
>>A.10.1(86)]. A logical thing for this finalization to do is to make sure 
>>that
>>the last line is terminated, and it appears that your implementation does 
>>this.
>>
> Heck, isn't there some mention of also having an EOF marker written?

Right, but there is no requirement in Ada that EOF markers have any 
particular representation. In particular, they might be written as <CR><LF> 
sometimes, and simply "virtual" in other cases. (End-of-page markers are 
almost always handled as "virtual" at the end of files, because no one wants 
every file to end with <FF>.) Janus/Ada never writes any EOF or EOP 
characters at the end of files; Get "manufactures" them if they are not 
present at the end of a file. That makes reading from a text file much more 
complex, but it also means that pretty much any text file can be read with 
Text_IO and it will behave sensibly.

                                            Randy.


      parent reply	other threads:[~2013-08-19 21:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16  1:02 What's the cause of extra new line with Text_IO when program exit Zhu, Qun-Ying
2013-08-16  3:17 ` Jeffrey Carter
2013-08-17 17:54   ` Dennis Lee Bieber
2013-08-17 21:54     ` Jeffrey Carter
2013-08-19 21:58     ` Randy Brukardt [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox