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 02:51:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Computer Language Shootout Date: Sat, 19 Jul 2003 09:51:08 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <1ec946d1.0307150715.4ba69f85@posting.google.com> <3F149243.80304@attbi.com> <3F15930C.2070907@attbi.com> NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1058608268 10921 129.241.83.78 (19 Jul 2003 09:51:08 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Sat, 19 Jul 2003 09:51:08 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:40498 Date: 2003-07-19T09:51:08+00:00 List-Id: Robert Spooner wrote: > I tried this using the following program and gnat version 3.13p on > windows professional 2000 with the following result: > > with Ada.Text_IO; > > procedure No_String_Length_Limit_Test is > > package Tio renames Ada.Text_IO; > > > function Get_Line (Buffer_Size : Positive := 1) return String is > Buffer : String (1..Buffer_Size); > Last : Natural; > begin > Tio.Get_Line (Buffer, Last); > if Last < Buffer'Last then > return Buffer(1..Last); > else > return Buffer & Get_Line (2*Buffer_Size); This removes the ambigutie: return Buffer & Get_Line (Buffer_Size => 2*Buffer_Size); -- Ada95 is good for you. http://www.crystalcode.com/codemage/MainMenu/Coding/Ada/IntroducingAda.php