comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: Keyboard input
Date: 22 Sep 90 20:13:26 GMT	[thread overview]
Message-ID: <2166@sparko.gwu.edu> (raw)
In-Reply-To: 920031@hpclapd.HP.COM

In article <920031@hpclapd.HP.COM> defaria@hpclapd.HP.COM (Andy DeFaria) writes:
>>/ hpclapd:comp.lang.ada / sampson@cod.NOSC.MIL (Charles H. Sampson) /  4:20 pm  Sep 20, 1990 /
>
>Sure, sure, sure... But what if he Ada programmer, like the initial poster,
>*WANTS*  to  do  their own  single  character I/O   and handle any editting
>process,  perhaps   to provide  a different,   more  friendly or consistent
>editting process, huh?  How does he/she do it?
Actually, your PPS has the answer.
>
>P.S.	I hate when people don't answer the question posed
>P.S.S.	I'm  also not answering the  question but  I don't know the answer.
>	Perhaps the solution is  to call the OS  routine (read or getc) but
>	that isn't Ada or portable.
Indeed the solution is to call a routine from the operating system,
preferably by writing exactly the IO routine you need in C (for instance)
and making it Ada-callable by using pragma INTERFACE.

I'm not sure what you mean by "it isn't Ada or portable." If you mean that
it should have been included as a standard I/O package, you may be right;
I think I'd agree. But the fact is that is was _not_ included, and every
Text_IO implementation I'm aware of uses buffered input which requires a
CR to transmit the buffer contents. Some implementers have provided
additional I/O packages; some have not.

There are _lots_ of things that people could say should have been included
in the standard; undoubtedly your list would not be exactly the same list
as mine. That's the way it goes; the standard can't include everything in
the whole world. So we all cope by adding additional packages. If they
have to be written in another language and "pragma INTERFACE-d" to make
them Ada-callable, that is not sinful. Indeed, why else would this pragma
be in the language? At least the standard foresaw that OS services or
"foreign-language" programs would have to be called and provided the "hooks"
to do it. 

I would like very much to see a portable character-IO library -
portable in the sense that there would be an implementation-independent
package spec. The routine described by Rick Conn in a previous posting is
a good start in this direction. I will see if I have a copy and post it.
The package _body_ will necessarily be OS-dependent, because it's something
that can't be directly written in Ada.
---------------------------------------------------------------------------
Prof. Michael Feldman
Department of Electrical Engineering and Computer Science
The George Washington University
Washington, DC 20052
202-994-5253
mfeldman@seas.gwu.edu
---------------------------------------------------------------------------

  reply	other threads:[~1990-09-22 20:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-09-18 20:32 Keyboard input Gregory M. Stelmack
1990-09-19 19:27 ` Terry J. Westley
1990-09-20 20:29   ` Gregory M. Stelmack
1990-09-20 23:20   ` Charles H. Sampson
1990-09-21 17:50 ` Andy DeFaria
1990-09-22 20:13   ` Michael Feldman [this message]
1990-09-24  8:58     ` Richard A. O'Keefe
1990-09-24 13:58       ` Michael Feldman
1990-09-24 16:27         ` Keyboard input on IBM mainframes Jerry Callen
1990-09-24 17:44           ` Ada " Michael Feldman
1990-09-26 13:16             ` ryer
1990-09-26  0:16         ` Keyboard input Chris Holl @adonna
1990-09-22  0:21 ` Naasif Gierdien
1990-09-22  0:25   ` Naasif Gierdien
1990-09-24 16:18 ` Andy DeFaria
1990-09-25 14:11   ` Edward Falis
1990-09-25 15:10   ` Michael Feldman
1990-09-25 18:13   ` John Prentice
1990-09-25 13:36 ` stt
  -- strict thread matches above, loose matches on Subject: below --
1990-09-24 19:00 "EDWARD CRAGG"
replies disabled

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