comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: C getchar() functionality in Ada
Date: Tue, 17 Feb 2009 16:39:14 -0800 (PST)
Date: 2009-02-17T16:39:14-08:00	[thread overview]
Message-ID: <8b9e97e1-0f91-458d-94de-9bfb44462c06@u8g2000prd.googlegroups.com> (raw)
In-Reply-To: u2Fml.12022$lk5.10791@newsfe13.iad

On Feb 17, 12:24 pm, Hyman Rosen <hyro...@mail.com> wrote:
> Thomas Locke wrote:
> > But I understand what you're saying: No end of line characters in Ada!
> > Except perhaps when using Get_Immediate and Look_Ahead?
>
> The Ada design has the same error here as Pascal did.
> End of Line and End of File are like a craps table;
> you can know whether the table *was* hot or cold, but
> you cannot know whether the table *will be* hot or
> cold. Similarly, you cannot know whether you are at
> end of line or end of file until you have tried reading
> a character. Ada pretends otherwise, but behind the
> scenes it's doing a secret character read-ahead, which
> is what causes the odd behavior.
>
> I speak about the various modern OSes. Presumably, once
> upon a time input was such that this paradigm made sense,
> just like Fortran had special output formatting characters
> to rotate the roll of paper.

I'm not sure if you're implying that VMS is one of those OS's that are
as outdated as Fortran's formatting characters and horse-drawn
carriages, but when Ada's Text_IO package was designed, VMS was a big
thing.  And VMS text files do not (or didn't) have end-of-line
"characters".  They weren't organized just as amorphous streams of
bytes as they are on Unix-like systems and on Windows, but the OS
itself structured the files into lines.  Ada was designed to be
portable, so in that context I don't think its design was a mistake; a
design that relied on text files to be viewed as having "characters"
to separate lines, pages, etc., *would* probably have been a mistake,
when the goal of portability is kept in mind.

                                -- Adam




  parent reply	other threads:[~2009-02-18  0:39 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
2009-02-18  0:39       ` Adam Beneschan [this message]
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