From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,794c64d1f9164710 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-22 18:03:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3C76F847.3C242292@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: functions, packages & characters References: <20020221130715.12738.00000034@mb-bg.aol.com> <3C753C66.8020509@mail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 23 Feb 2002 02:03:13 GMT NNTP-Posting-Host: 209.86.200.72 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1014429793 209.86.200.72 (Fri, 22 Feb 2002 18:03:13 PST) NNTP-Posting-Date: Fri, 22 Feb 2002 18:03:13 PST Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Fri, 22 Feb 2002 18:03:11 PST (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:20277 Date: 2002-02-23T02:03:13+00:00 List-Id: Marin David Condic wrote: > > Wait a minute...... I seem to recall a nifty example of how you could return > an arbitrary length string from a function that used Get/Get_Line (?) and > recursed in the event that the line was longer than the buffer. It might be > in a code example somewhere like on AdaPower? If you can do that, why not a > similar subprogram for Unbounded_String? It would be even easier and not > require recursion since you could just keep reading some arbitrary sized > buffer in a loop and appending it to an Unbounded_String that is returned to > the caller. Such as function PragmARC.Get_Line? It uses a String of only 100 characters, yet still avoids recursion in most applications. A procedure that built a result in a mode in out [Un]Bounded_String parameter is perfectly doable would not need to be recursive. But the point of a Get_Line function, which dates from the days of Ada 83 (see "Variable-Length String Input in Ada" by J. Carter in ADA LETTERS, 1989 May/Jun), is that you rarely need a variable string abstraction in Ada if you really understand how to use one-dimensional arrays in Ada. -- Jeff Carter "You cheesy lot of second-hand electric donkey-bottom biters." Monty Python & the Holy Grail