comp.lang.ada
 help / color / mirror / Atom feed
From: kst@alsys.com (Keith Thompson)
Subject: Re: Help with gnat IO
Date: Thu, 1 Dec 1994 03:10:51 GMT
Date: 1994-12-01T03:10:51+00:00	[thread overview]
Message-ID: <D043I4.D9v@alsys.com> (raw)
In-Reply-To: 3bg8je$hsr@gnat.cs.nyu.edu

In <3bg8je$hsr@gnat.cs.nyu.edu> dewar@cs.nyu.edu (Robert Dewar) writes:
> There is no Get_String function (was there really a procedure with that
> name in Ada 80??)

Yes.

>                   There are however versions of get that get from a string,
> which is presumably what you are looking for.

I don't think that's what he was looking for.

In fact, Ada 80's Text_IO has two overloaded Get_String functions
(not procedures):

    function GET_STRING(FILE: in IN_FILE) return STRING;
    function GET_STRING return STRING;

	Perform GET operations on the specified in file, skipping any
	leading blanks (that is, spaces, tabulation characters or line
	marks) and returns as result the next sequence of characters up
	to (and not including) a blank.  The default file is the current
	input file.

Likewise, the Get_Line routines were also functions returning STRING;
they now return the string and its 'Last in OUT parameters.

Out of curiosity, why was this change made?  The current version of
Get_Line makes it difficult to read arbitrarily long lines; you have to
decide the maximum length before reading the line.  (At least it behaves
gracefully if the line is longer than the string you provide.)

It looks like GET_STRING would have been a handy thing to have in some
cases, but perhaps a bit too specialized to include in the language;
it shouldn't be too hard to implement it on top of the existing routines.

> 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 :-)

You can have my 1980 RM (and 1979 RM and rationale) when you pry them ...
you know the rest.  8-)}

-- 
Keith Thompson (The_Other_Keith)  kst@alsys.com
TeleSoft^H^H^H^H^H^H^H^H Alsys, Inc.
10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718
/user/kst/.signature: I/O error (core dumped)



  reply	other threads:[~1994-12-01  3:10 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 [this message]
1994-12-01 13:34   ` Bob Duff
  -- 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