From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ad4:558e:0:b0:56e:97e6:81e4 with SMTP id f14-20020ad4558e000000b0056e97e681e4mr1998852qvx.4.1677178078581; Thu, 23 Feb 2023 10:47:58 -0800 (PST) X-Received: by 2002:a05:6808:f05:b0:37f:83ba:ee74 with SMTP id m5-20020a0568080f0500b0037f83baee74mr424580oiw.1.1677178078279; Thu, 23 Feb 2023 10:47:58 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 23 Feb 2023 10:47:57 -0800 (PST) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2001:861:3006:e580:fb20:5e3c:f153:3003; posting-account=I_eLtQoAAAA-qV4zTYNhsy2EmfPsGcSc NNTP-Posting-Host: 2001:861:3006:e580:fb20:5e3c:f153:3003 References: <75c3990e-eaab-47eb-bdba-3827b9fd4751n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <72723295-3b36-412f-a5fc-f1dd2f5a56edn@googlegroups.com> Subject: Re: wait does not perform as expected From: Daniel Gaudry Injection-Date: Thu, 23 Feb 2023 18:47:58 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:64974 List-Id: On Thursday, February 23, 2023 at 7:29:36=E2=80=AFPM UTC+1, Niklas Holsti w= rote: > On 2023-02-23 20:14, Dmitry A. Kazakov wrote:=20 > > On 2023-02-23 18:35, Niklas Holsti wrote:=20 > >> On 2023-02-23 16:26, AdaMagica wrote:=20 > >>> Niklas Holsti schrieb am Mittwoch, 22. Februar 2023 um 18:36:06 UTC+1= :=20 > >>>> On my system, Get_Immediate does /not/ use the inputs collected (but= =20 > >>>> not=20 > >>>> "consumed") by Look_Ahead, but instead checks if there are _new_ inp= ut=20 > >>>> keystrokes. If there are none, Get_Immediate returns "not Available"= =20 > >>>> (Hit is False) and so the loop continues.=20 > >>>=20 > >>> Are you sure?=20 > >>=20 > >> That is what I observe.=20 > >=20 > > The implementation of Look_Ahead calls getc followed by ungetc. Thus it= =20 > > blocks until an input if there is no buffered. And not just input, but= =20 > > for a line or file end. > That seems in order.=20 >=20 > However, the crux of the question is in Get_Immediate. Do you know how=20 > that is implemented on various systems? It has to disable line buffering= =20 > and line editing on the input stream. One question is whether and how=20 > such "tty" configuration changes affect whatever buffers getc/ungetc use.= =20 >=20 > On my system, if Look_Ahead uses getc and ungetc, it seems Get_Immediate= =20 > does not use the same buffers, and has no effect on those buffers. That= =20 > could be desirable behaviour in some cases, undesirable in others.=20 >=20 > On AdaMagica's system, it seems that Get_Immediate uses the same buffers= =20 > as Look_Ahead (getc/ungetc). Hi, On my ubuntu system the=20 ada.text_io.GET_IMMEDIATE(ITEM =3D> CHAR, AVAILABLE =3D> HIT); just pause the program regardless of any key being hit. I just cannot use a wait (several shorts one in a row) interrupted by a ke= y hit. Any possibility you may know of ?? My Best Regards