comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: End_Of_File but not really
Date: Sat, 9 Dec 2006 20:57:41 -0800
Date: 2006-12-09T20:57:41-08:00	[thread overview]
Message-ID: <4-adnQeuHcj3DubYnZ2dnUVZ_oOonZ2d@comcast.com> (raw)
In-Reply-To: oJednfF3KqVVLOXYnZ2dnUVZ_q-dnZ2d@megapath.net


"Randy Brukardt" <randy@rrsoftware.com> wrote in message 
news:oJednfF3KqVVLOXYnZ2dnUVZ_q-dnZ2d@megapath.net...
[snip]
>
> As I noted before, there is absoletely no chance that this behavior (or 
> any
> behavior of Text_IO) would be changed, because there's no possible way for
> such a change to the compatible. If the program "knows" about the "lost"
> blank line, it might fail badly if the definition was to be changed. So 
> it's
> 23 years too late to fix Text_IO.
>

Actually... couldn't the "Form" option that is passed to Open include an 
option that changes the end of file behavior?  That wouldn't break old code, 
but would make new code easier.

Steve
(The Duck)


> The moral is simply to never use Text_IO.End_of_File, but rather handle
> End_Error instead. If you try to use End_of_File, you have the potential 
> of
> "losing" the last line of the file, you still can have End_Error raised if
> you call Get or Get_Line when there is no <LF> character at the end of the
> file, your program will run slower, and your program won't be able to read
> interactively from the keyboard. It's not worth it, no matter what you 
> think
> about using exceptions for non-errors.
>
>                              Randy.
>
> 





  parent reply	other threads:[~2006-12-10  4:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-07 18:00 End_Of_File but not really Adam Beneschan
2006-12-07 20:17 ` Jeffrey R. Carter
2006-12-07 23:25   ` Adam Beneschan
2006-12-08  0:29 ` Randy Brukardt
2006-12-08 17:02   ` Adam Beneschan
2006-12-08 23:02     ` Randy Brukardt
2006-12-24  0:54     ` Craig Carey
2006-12-26  7:44       ` Craig Carey <research@ijs.co.nz>
2006-12-10  4:57   ` Steve [this message]
2006-12-11 22:49     ` Randy Brukardt
replies disabled

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