comp.lang.ada
 help / color / mirror / Atom feed
From: mph@lion.inmos.co.uk (Mike Harrison)
Subject: Re: TEXT_IO anomality
Date: 13 Aug 90 09:32:52 GMT	[thread overview]
Message-ID: <9558@ganymede.inmos.co.uk> (raw)
In-Reply-To: 2040@cod.NOSC.MIL

In article <2040@cod.NOSC.MIL> sampson@cod.nosc.mil.UUCP (Charles H. Sampson) writes:
> ...
>
>| Furthermore, I think that changing the behavior of TEXT_IO to take
>| account of interactions between input and output on a terminal would be a very
>| bad idea.  It would mean, one presumes, that the runtime system would have
>| to maintain implicit links between files that read and write from 
>| terminals; that every write to a terminal would involve first checking
>| for input from the terminal (so as to get the correct final values for
>| LINE and COL); and a few other implications I have undoubtably missed.
>
>     An implementation that looks promising and easy is to have the file
>control block (or whatever the implementation calls it) point to a block
>that contains the three numbers and any other data that might be affected
>by the interplay between the two files.  An action on either would then be
>immediately available for the other.  Of course, asynchronous access to
>either file would cause problems, but asynchronous access to the terminal
>is already known to be something that must be handled carefully.
>

I hit the same problem about 3 years ago (in a previous job), the solution 
we adopted was to define a new i/o package called TERMINAL_IO, whose syntax
was a suitable subset of TEXT_IO, but whose semantics implemented the sort
of interactions between input and output that you want at a terminal.

Unfortunately, the package was implemented by a colleague, so I can't give
any details of the internals or any special problems he had to solve.

The result was *exactly* what I wanted and avoided compromising the behaviour 
of our normal TEXT_IO.

The TERMINAL_IO package was included in the delivered Ada product.

Mike,




Michael P. Harrison - Software Group - Inmos Ltd. UK.
-----------------------------------------------------------
UK : mph@inmos.co.uk             with STANDARD_DISCLAIMERS;
US : mph@inmos.com               use  STANDARD_DISCLAIMERS;

  reply	other threads:[~1990-08-13  9:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-07-25  7:03 TEXT_IO anomality "Jonathan B. Owen"
1990-07-25 17:14 ` Charles H. Sampson
1990-07-26  6:54   ` Paul Hilfinger
1990-07-26 15:02     ` Vinod Grover
1990-07-28  1:20       ` Danford Lehman
1990-08-06 19:44     ` Charles H. Sampson
1990-08-13  9:32       ` Mike Harrison [this message]
  -- strict thread matches above, loose matches on Subject: below --
1990-07-26 14:32 "", Mats Weber
replies disabled

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