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.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,45b47ecb995e7a3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-14 08:12:49 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <3B6F1B2F.4FC3C833@gsde.hou.us.ray.com> <5ee5b646.0108071819.6e84e33d@posting.google.com> <3_Xc7.45$NM5.84779@news.pacbell.net> <9lb8mh$9am$1@nh.pace.co.uk> Subject: Re: Ada Idioms Progress Preview Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Tue, 14 Aug 2001 11:12:34 EDT Organization: http://www.newsranger.com Date: Tue, 14 Aug 2001 15:12:34 GMT Xref: archiver1.google.com comp.lang.ada:11919 Date: 2001-08-14T15:12:34+00:00 List-Id: In article <9lb8mh$9am$1@nh.pace.co.uk>, Marin David Condic says... >in this area. Suppose that a Get_Line were to return an access to a string >instead of putting characters into your own string and giving you a length? Actually, making it a function returning a String would be sufficient (and a definite improvement). Its probably going to be a less efficient solution than the buffer-length procedure though. That would probably put off a lot of people. But it is rare that I'm doing I/O and sweating a few extra cycles (the wait for the disk or the typing user is going to swamp most other considerations). Martin Carlisle had a good solution for this, which is posted at AdaPower at http://www.adapower.com/adacode.html. It uses recursion, but I don't think the stack impact is much more than 2n where n is the string size. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com