comp.lang.ada
 help / color / mirror / Atom feed
From: Evans@TL-20B.ARPA ("Art Evans")
Subject: Re: text_io considered error prone?
Date: Tue, 10-Sep-85 22:34:22 EDT	[thread overview]
Date: Tue Sep 10 22:34:22 1985
Message-ID: <8509110230.AA06329@UCB-VAX.ARPA> (raw)
In-Reply-To: Bakin@MIT-MULTICS.ARPA

As I read Chapter 14, Bakin's challange is unfair.  In 14.3(6) and (7),
there is a careful definition of what Ada means by "text file".  TEXT_IO
provides for I/O from such a file, and for nothing else.  The last
sentence of (7) says
    The effect of input or output of control characters (other than
    horizontal tabulation) is not defined by the language.
Thus it's not surprising that copying an arbitrary string of ASCII
characters is beyond the capabilities of TEXT_IO.

As for the three cases Bakin wants to test for, #2 and #3 refer to "an
ASCII form feed".  Since that's an ASCII control character, the sentence
I just quoted makes it clear that it cannot be dealt with.

I think Bakin's subject field for his message ("text_io considered error
prone?") is unfair to Ada, as his message points out deficiencies in
TEXT_IO but does not address the question of whether or not TEXT_IO is
error prone.  It's not surprising that TEXT_IO is "deficient", in the
sense that there are things one might want to do with arbitrary files of
ASCII characters that cannot be done with TEXT_IO.  So what?  TEXT_IO
provides useful functionality for an important subset of all possible
ASCII files, and I expect that expanding its capabilities would have
unacceptable costs.  Moreover, as Bakin points out, since Ada provides
other ways to accomplish what is beyond TEXT_IO, there is no loss of
functionality.

As an additional point: When Bakin said he was concerned with an
"arbitrary text file", I expected he would worry about bare CR or bare
LF (one of those characters other than in the CR-LF sequence).  But,
that was before I reread 14.3.  Such files are beyond many I/O systems.

Art Evans/Tartan Labs
-------

       reply	other threads:[~1985-09-11  2:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Bakin@MIT-MULTICS.ARPA>
1985-09-11  2:34 ` "Art Evans" [this message]
1985-09-17 12:44 Text_io considered error prone? "David S. Bakin"
  -- strict thread matches above, loose matches on Subject: below --
1985-09-12  6:10 text_io " Paul Hilfinger
1985-09-12  1:17 Keith F. Lynch
1985-09-11  3:32 "David S. Bakin"
1985-09-11  0:46 "David S. Bakin"
replies disabled

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