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,386228a37afe967f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-19 12:04:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!torn!snoopy.risq.qc.ca!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Computer Language Shootout Date: 19 Jul 2003 15:04:14 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1ec946d1.0307150715.4ba69f85@posting.google.com> <3F149243.80304@attbi.com> <3F15930C.2070907@attbi.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1058641454 4353 199.172.62.241 (19 Jul 2003 19:04:14 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 19 Jul 2003 19:04:14 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:40510 Date: 2003-07-19T15:04:14-04:00 List-Id: Pascal Obry writes: > Robert A Duff writes: > > > "Jean-Pierre Rosen" writes: > > > > > This one reads a line with no length limit: > > > > > > function Get_Line return String is > [...] > > > > Too bad this was not included in Text_IO itself. It would save > > beginners a lot of trouble. Sigh. > > But this approach can use a lot of stack space and become very slow. > Returning an unconstraint object on the stack has a cost. True, but I think the design goal of Text_IO ought to be correctness, and convenience for the programmer, not efficiency. I'm sick of programs that have arbitrary line-length limits. I'll happily pay a little efficiency cost to correct that. And in the cases where efficiency matters, a different strategy can be used (namely, the Get_Line that takes a fixed-length buffer, or a get-next-token kind of approach, which doesn't care about line lengths). - Bob