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-Thread: a07f3367d7,3a6a9f1d654285ba X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 03 Sep 2009 12:39:13 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada Shootout program for K-Nucleotide (patches) References: <4a743343$0$32674$9b4e6d93@newsspool2.arcor-online.net> <0c18b36c-7af0-454c-8208-9b0416111a1f@w41g2000yqb.googlegroups.com> <4a758ce2$0$31338$9b4e6d93@newsspool4.arcor-online.net> <4a967b33$0$32671$9b4e6d93@newsspool2.arcor-online.net> <4a9d06b9$0$30234$9b4e6d93@newsspool1.arcor-online.net> <4a9e3051$0$30220$9b4e6d93@newsspool1.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a9f9cd1$0$31871$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 03 Sep 2009 12:39:13 CEST NNTP-Posting-Host: f66dd988.newsspool3.arcor-online.net X-Trace: DXC=E^P]^?DTZWOWDmlTRbh@=IMcF=Q^Z^V3H4Fo<]lROoRA^YC2XCjHcbInO``l Ole-Hjalmar Kristensen schrieb: >>>>>> "GB" == Georg Bauhaus writes: > GB> It looks like copying In_Buf(Start..I-1) be circumvented. > GB> I have added a solution to Line_IO. > > How did you avoid the copying? Only in the non-recursive case, and only "inside" the subprogram, by renaming the slice in question and then either - create an overlay where some string object (of a subtype with the needed bounds) uses the renamed slice as storage. (Perhaps use Unchecked_Conversion if Randy's comments on Gem #39 suggest it.) Or, - convert said renamed slice to a string subtype with proper bounds. I'm still struggling (in spare free time) with long lines with or without terminators, proper End_Error (to mimick Text_IO.Get_Line's behavior), terminal I/O, and recursion. (An interesting test case (from a still open Python bug) is this: $ cat | ./line_reading_program asdf ^D $ ./line_reading_program asdf ^D