On Thu, 26 Nov 1998 10:37:46 +0100 Otto Stolz
<[log in to unmask]> wrote:
> On Wed, 25 Nov 1998, Phillip Helbig wrote:
> > The problem is perhaps that actually specifying this in the standard
> > would not be possible because it moves beyond the domain of the
> > standard.
>
> Am 1998-11-25 um 18:06 h hat Clive Page geschrieben:
> > I am not convinced of this. [...] I'm not asking for anything difficult,
> > just the ability to output a record without the terminator (LF or CR,LF,
> > or CR or whatever) usual in a text file. I really don't see the problem.
>
> The problem is that different operating systems have different models
> of the terminal. You are making, tacitly, assumptions that do not hold,
> universally, viz.
> - the terminal (aka console) is handled akin to a text file,
> - in a text file, the record is terminated by a character sequence,
> - the Fortran-defined data records are mapped to lines of a text file,
> or on the screen of a terminal.
>
> While the third assumption seems to be generally true (for formatted output
> only), the former two do definitely not hold everywhere. I have used operat-
> ing systems that treat the terminal quite different from a text file, and
> I have used operating systems that handle records (as opposed to character
> streams), in files, so there is no line-terminating character involved.
> Fortran does not treat the terminal as a (one) text file, either, see below.
>
> I reckon, in order to achieve what Clive wants to have, a programming language
> standard will have to model the terminal's behaviour to some extend, so it
> can discuss vertical and horizontal movement of the writing position, as
> well as the interaction of output and input, on the same device.
>
> Hitherto, the Fortran standards have avoided (refused?) to do so.
> READ(UNIT=*) and WRITE(UNIT=*) are defined to refer to different units;
> hence, any interaction between characters written to the terminal,
> and read from the terminal, by these statements, is undefined. Theoreti-
> cally speaking, an implementation that would buffer all output until
> program termination could be standard-conforming, as well as a program
> that would read and buffer all input at program start. So, the standard
> does not even guarantee that you can program a dialogue (i. e. writing a
> prompt before the answer must be typed in) -- let alone a particular layout
> for such dialogue (such as having the answer on the same line as the
> respective prompt).
>
the problem is not restricted to fortran. whilst working at
imperial college i had to support 'standard' pascal. the compiler
was on a cdc system. it came from eth and was written by wirth.
due to the interaction between telex (a program that ran on a
peripheral processor and handling terminal i/o) and the user program
running on the cpu the prompt for user input (a ?) appeared BEFORE
the first text in a writeln.
the original compiler was i guess developed in a batch environment.
the solution involved some additional non-standard features
of pascal.
clive might be old enough to remember this as his university was
one of the small number of cdc educational sites in the uk.
manchester and the university of london computer centre were the
others.
> I do not imply that these features were superfluous; I am just pointing
> to the difficulties in defining them.
>
> Best wishes,
> Otto Stolz
----------------------
Ian Chivers
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|