comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@dsd.camb.inmet.com (Bob Duff)
Subject: Re: Help with gnat IO
Date: Thu, 1 Dec 1994 13:34:12 GMT
Date: 1994-12-01T13:34:12+00:00	[thread overview]
Message-ID: <D04wD1.DyH@inmet.camb.inmet.com> (raw)
In-Reply-To: 3bg8je$hsr@gnat.cs.nyu.edu

In article <3bg8je$hsr@gnat.cs.nyu.edu>, Robert Dewar <dewar@cs.nyu.edu> wrote:
>There is no Get_String function (was there really a procedure with that
>name in Ada 80??) There are however versions of get that get from a string,
>which is presumably what you are looking for.

No, I don't think that's what the original poster was looking for.  In
Ada 80, there was a *function* Get_String:

    function GET_STRING(FILE: in IN_FILE) return STRING;

This would skip any blanks, then read nonblank characters, and return
everything up to the next blank (a newline is considered a blank).
E.g.:

    foo bar baz-bat

Three calls to GET_STRING would return "foo", "bar", and "baz-bat".

There was also a GET_LINE function, with similar behavior.

Sounds pretty useful.  It was probably deleted because it's a little bit
tricky to implement.  (Where do you buffer the characters, on a system
like Unix, where you can't tell how long the line is until you've read
it?  The current language requires the programmer to answer that
question.)

Other interesting differences in Text_IO: In 1980, IN_FILE and OUT_FILE
were two separate types; the mode business did not exist.  In 1979,
there were I/O procedures for the types INTEGER and FLOAT (instead of
the generic versions).

>I posted this just because I thought people would be entertained at the
>idea of an Ada beginner somehow getting hold of the July 1980 version of
>the RM! Perhaps we should have burnt all the copies :-)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:-)

I have occasionally found pre-1983 versions useful during the design of
Ada 9X.

- Bob
-- 
Bob Duff                                bobduff@inmet.com
Oak Tree Software, Inc.
Ada 9X Mapping/Revision Team (Intermetrics, Inc.)



  parent reply	other threads:[~1994-12-01 13:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-28 11:28 Help with gnat IO Woodrow Yeung
1994-11-28 18:13 ` Tom Griest
1994-11-29 22:05 ` Robert Dewar
1994-12-01  3:10   ` Keith Thompson
1994-12-01 13:34   ` Bob Duff [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-11-29 17:52 Bennett, Chip (KTR) ~U
replies disabled

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