From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: Keyboard input Message-ID: <2166@sparko.gwu.edu> Date: 22 Sep 90 20:13:26 GMT References: <39@screamer.csee.usf.edu> <920031@hpclapd.HP.COM> Reply-To: mfeldman@seas.gwu.edu () Organization: The George Washington University, Washington D.C. List-Id: 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 ---------------------------------------------------------------------------