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-21 15:43:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!isdnet!freenix!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: functions, packages & characters Date: Thu, 21 Feb 2002 17:44:02 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <20020221130715.12738.00000034@mb-bg.aol.com> <3C753C66.8020509@mail.com> X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:20232 Date: 2002-02-21T17:44:02-06:00 List-Id: Hyman Rosen wrote in message <3C753C66.8020509@mail.com>... >Unversed Angel wrote: >> Line_Buffer : String (1 .. 1000); > >It's the twenty-first century. Isn't it about time we >got rid of fixed-size input buffers? Thank goodness >for the GNU reimplementation of the UNIX utilities, >which have done away with maximum line sizes, but on >my Sun, I still can't vi in a 200 column xterm. Nice try, but he's using Ada.Text_IO.Get_Line, which takes a fixed length string. So he pretty much has to use a fixed size buffer. Text_IO doesn't have direct support for unbounded strings (because having it would drag the unbounded string library into almost every program, whether you used it or not). Possibly, there ought to be a Get_Line for Unbounded strings in a child package of Text_IO (but this does not exist in Ada 95). This would be quite a bit slower than the regular Get_Line for long lines, but it could be made acceptably fast for the common case of short lines. It is possible to write such a Get_Line out of the primitives in Text_IO, but the result would be unacceptably slow (because you would have to read a character at a time - you can't use Get_Line because you can't tell between the case of a line which exactly fills the buffer and a line which is too long and does not -- but in the former case, the line terminator is skipped). Randy.