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 17:05:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!freenix!proxad.net!nerim.net!newsspool.nerim.net!beeblebrox!nobody From: Samuel Tardieu Newsgroups: comp.lang.ada Subject: Re: Computer Language Shootout Date: Sun, 20 Jul 2003 01:14:24 +0200 Organization: Avian Carrier & Friends Message-ID: <87k7aeqfcf.fsf@inf.enst.fr> References: <1ec946d1.0307150715.4ba69f85@posting.google.com> <3F149243.80304@attbi.com> <3F15930C.2070907@attbi.com> NNTP-Posting-Host: willow.rfc1149.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: biggoron.nerim.net 1058659501 35980 213.41.154.244 (20 Jul 2003 00:05:01 GMT) X-Complaints-To: abuse@nerim.net NNTP-Posting-Date: Sun, 20 Jul 2003 00:05:01 +0000 (UTC) Mail-Copies-To: sam@rfc1149.net User-Agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.5 (cauliflower, i386--freebsd) Cancel-Lock: sha1:RkRaB1lsE/eQFWa/D4Id4LAwFqE= X-Leafnode-NNTP-Posting-Host: 127.0.0.1 X-Leafnode-NNTP-Posting-Host: 2001:7a8:5af4:3:202:2dff:fe5c:9049 Xref: archiver1.google.com comp.lang.ada:40513 Date: 2003-07-20T01:14:24+02:00 List-Id: >>>>> "Bob" == Robert A Duff writes: Bob> True, but I think the design goal of Text_IO ought to be Bob> correctness, and convenience for the programmer, not efficiency. Bob> I'm sick of programs that have arbitrary line-length limits. Bob> I'll happily pay a little efficiency cost to correct that. And Bob> in the cases where efficiency matters, a different strategy can Bob> be used (namely, the Get_Line that takes a fixed-length buffer, Bob> or a get-next-token kind of approach, which doesn't care about Bob> line lengths). Bob, while I understand why and where such a function would be practical, I am opposed to it being part of the standard. The reason is that it would make it much too easy to crash any Ada program by feeding it with a long string that would exhaust the stack area (be it the primary stack or, as in GNAT, a secondary stack). In programs with tasking, the stack for each task is usually very limited. You can always use Ada.Strings.Unbounded.Text_IO.Get_Line and convert it to a string *after you check the length*. You will achieve the same effect and will not have to rely on (expensive or unreliable) stack checks. Sam -- Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/sam