From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: get_immediate echoe character--compiled error? Date: Wed, 4 Oct 2023 19:43:55 -0500 Organization: A noiseless patient Spider Message-ID: References: <87fs2tr2vf.fsf@nosuchdomain.example.com> <87lecku0bu.fsf@nosuchdomain.example.com> <874jj75joi.fsf@nosuchdomain.example.com> Injection-Date: Thu, 5 Oct 2023 00:43:29 -0000 (UTC) Injection-Info: dont-email.me; posting-host="ed5b3a88a5d01c01ded57c1be25af20a"; logging-data="634800"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+m7n53Q1mwQftUBre1OCkZzqY7bjmjLw8=" Cancel-Lock: sha1:EByjs05KYrVR1Iwcu2GrjILfeyI= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MSMail-Priority: Normal X-Priority: 3 X-RFC2646: Format=Flowed; Response Xref: news.eternal-september.org comp.lang.ada:65787 List-Id: "Jeffrey R.Carter" wrote in message news:ufjnu0$62ki$1@dont-email.me... > On 2023-10-04 13:38, Simon Wright wrote: >> >> Obviously you need to turn echoing off for password input. But neither >> the ARM nor the GNAT RM says anything about Get_Immediate's echoing >> behaviour, so it's hard to explain why OA does the same thing. Does its >> manual specify this behaviour? > > Unfortunately, Ada does not provide a standard way to turn off echo. > > I agree that the ARM says nothing about echo for any of its operations on > Standard_Input, but clearly there is a broad consensus of Ada.Text_IO > writers and users who think this is desirable behavior. For what it's worth, Janus/Ada turns off echoing, and that was decided without referring to any other implementation's choice in the matter. Rather, it was done to provide a way using standard calls to provide functionality that had always been available in Janus/Ada in a non-standard way. Specifically, Janus/Ada has always had a predefined file name "KBD:" (or "/dev/kbd" on Unix), which provides raw access to the keyboard device (or standard input on more modern systems). This did not echo (or do any line editing) on CP/M and MS-DOS, and we carried that same behavior over into more modern systems. For instance, the "Continue or Abort?" question in the compiler uses KBD: to take and discard input immediately without any waiting (usual standard input is line buffered and usually input is not processed until "enter" or similar is pressed). It seemed to us that the Get_Immediate function was intending the same sorts of uses. Note that implementing it this way makes it hard to get meaningful results if Get_Immediate is mixed with other input on the same file. (That's why we treated it as a special file in the beginning, but even that gets confused if someone else reads from Standard_Input.) Randy.