From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: get_immediate echoe character--compiled error?
Date: Wed, 4 Oct 2023 19:43:55 -0500 [thread overview]
Message-ID: <ufl0rh$jbtg$1@dont-email.me> (raw)
In-Reply-To: ufjnu0$62ki$1@dont-email.me
"Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not> 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.
next prev parent reply other threads:[~2023-10-05 0:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 2:42 get_immediate echoe character--compiled error? richardthiebaud
2023-10-02 5:48 ` Keith Thompson
2023-10-02 20:07 ` richardthiebaud
2023-10-02 22:27 ` Keith Thompson
2023-10-02 22:41 ` richardthiebaud
2023-10-02 22:47 ` richardthiebaud
2023-10-03 8:41 ` Niklas Holsti
2023-10-03 10:20 ` Simon Wright
2023-10-04 0:13 ` Keith Thompson
2023-10-04 8:22 ` Simon Wright
2023-10-04 10:48 ` Jeffrey R.Carter
2023-10-04 11:38 ` Simon Wright
2023-10-04 13:05 ` Jeffrey R.Carter
2023-10-05 0:43 ` Randy Brukardt [this message]
2023-10-04 16:55 ` Niklas Holsti
2023-10-04 19:39 ` Keith Thompson
2023-10-04 21:20 ` Niklas Holsti
2023-10-03 21:00 ` G.B.
2023-10-04 21:14 ` Jeffrey R.Carter
2023-10-04 22:12 ` Keith Thompson
2023-10-05 9:51 ` Jeffrey R.Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox