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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!v4g2000vba.googlegroups.com!not-for-mail From: =?UTF-8?Q?Tomek_Wa=C5=82kuski?= Newsgroups: comp.lang.ada Subject: Re: Howto read line from a stream Date: Wed, 3 Jun 2009 08:49:48 -0700 (PDT) Organization: http://groups.google.com Message-ID: <709e8a12-f967-43db-b76b-4852cf1db08b@v4g2000vba.googlegroups.com> References: <83317a97-dae5-4c84-a1ac-88a87833cf3f@q14g2000vbn.googlegroups.com> <1a90e055-44a3-4d00-b4cd-64798c731a55@e24g2000vbe.googlegroups.com> NNTP-Posting-Host: 83.28.65.42 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1244044188 7552 127.0.0.1 (3 Jun 2009 15:49:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 3 Jun 2009 15:49:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v4g2000vba.googlegroups.com; posting-host=83.28.65.42; posting-account=Ar5oKAoAAAD4cyp5eTv5CtR88dGtUxxC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; pl-PL; rv:1.9.0.10) Gecko/2009042708 Fedora/3.0.10-1.fc10 Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6187 Date: 2009-06-03T08:49:48-07:00 List-Id: On 1 Cze, 02:05, "Jeffrey R. Carter" wrote: > I might do something like > > function Get_Line (Channel : in Stream_Access) return String is > =A0 =A0 Char : Character; > begin -- Get_Line > =A0 =A0 Character'Read (Channel, Char); > > =A0 =A0 if Char =3D Ada.Characters.Latin_1.LF then > =A0 =A0 =A0 =A0return String'(1 =3D> Char); > =A0 =A0 else > =A0 =A0 =A0 =A0return Char & Get_Line (Channel); > =A0 =A0 end if; > end Get_Line; > How to measure which solution (mine or yours) is faster?