comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: C getchar() functionality in Ada
Date: Wed, 18 Feb 2009 05:44:26 GMT
Date: 2009-02-18T05:44:26+00:00	[thread overview]
Message-ID: <_eNml.383383$Mh5.78097@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: wccab8kbpdp.fsf@shell01.TheWorld.com

Actually you can input "end of line" and "end of file" character in Ada you 
just use the "Get_Immediate" routine in "Ada.Text_IO" instead of Get.

with Ada.Text_IO ;
use  Ada.Text_IO ;

procedure a is
    Keystroke : character ;
    Ready     : Boolean ;
  begin
    Keystroke := ' ' ;
    while Keystroke /= 'q' loop   -- just away to stop program
      Get_Immediate ( Keystroke, Ready ) ;
      if ready then
        Put ( Keystroke ) ;
      end if ;
    end loop ;
  end ;

And is "Ada.Text_IO" broken? Not if you use the correct routine or the correct
job. And Ada in the pure form, is a base that one can create better and more 
useful packages for each job that one needs.

In <wccab8kbpdp.fsf@shell01.TheWorld.com>, Robert A Duff <bobduff@shell01.TheWorld.com> writes:
>Hyman Rosen <hyrosen@mail.com> writes:
>
>> Thomas Locke wrote:
>>> But I understand what you're saying: No end of line characters in Ada!
>                                                                  ^^^^^^
>....in Ada.Text_IO.
>
>>> Except perhaps when using Get_Immediate and Look_Ahead?
>>
>> The Ada design has the same error here as Pascal did.
>      ^^^^^^^^^^
>....Ada.Text_IO design...
>
>Text_IO is a bit broken, I agree.  But you can also use streams,
>or you can interface directly to the underlying OS primitives.
>
>Ada has a lot of strengths, but unfortunately, the design of the
>Ada.Text_IO package is not one of them.
>
>- Bob




  reply	other threads:[~2009-02-18  5:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-16 20:36 C getchar() functionality in Ada Thomas Locke
2009-02-16 21:43 ` Jeffrey R. Carter
2009-02-17  7:23   ` Thomas Locke
2009-02-17  8:16     ` Niklas Holsti
2009-02-17 13:01       ` Georg Bauhaus
2009-02-17 22:03         ` Thomas Locke
2009-03-03  8:57         ` David Thompson
2009-02-17 20:48     ` Jeffrey R. Carter
2009-02-17 21:59       ` Thomas Locke
2009-02-16 23:46 ` Adam Beneschan
2009-02-17  7:19   ` Thomas Locke
2009-02-17  8:37     ` Jacob Sparre Andersen
2009-02-17 17:31       ` Keith Thompson
2009-02-17 14:57     ` Hibou57 (Yannick Duchêne)
2009-02-17 14:55   ` Hibou57 (Yannick Duchêne)
2009-02-17 10:37 ` m.collado
2009-02-17 22:07   ` Thomas Locke
2009-02-17 16:40 ` Jean-Pierre Rosen
2009-02-17 19:46   ` Thomas Locke
2009-02-17 20:24     ` Hyman Rosen
2009-02-17 23:44       ` Robert A Duff
2009-02-18  5:44         ` anon [this message]
2009-02-18  0:39       ` Adam Beneschan
2009-02-18  7:43     ` Jean-Pierre Rosen
2009-02-18 11:42       ` christoph.grein
2009-02-17 20:38   ` Jeffrey R. Carter
2009-02-18  7:46     ` Jean-Pierre Rosen
2009-02-18 10:41       ` christoph.grein
replies disabled

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