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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,51b151b4d322b1cc X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: ada.strings.unbounded "free" and "String_Access" Date: 2000/03/08 Message-ID: <38C6D4DE.D482DA0C@acm.org>#1/1 X-Deja-AN: 594926530 Content-Transfer-Encoding: 7bit References: <38C5B5AD.D310C559@mindspring.com> <38c6de74@eeyore.callnetuk.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 952558449 63.10.53.214 (Wed, 08 Mar 2000 15:34:09 PST) Organization: EarthLink Inc. -- http://www.EarthLink.net MIME-Version: 1.0 Reply-To: jrcarter@acm.org NNTP-Posting-Date: Wed, 08 Mar 2000 15:34:09 PST Newsgroups: comp.lang.ada Date: 2000-03-08T00:00:00+00:00 List-Id: Nick Roberts wrote: > > The purpose is simply this: if Unbounded_String doesn't give you quite > enough flexibility in certain parts of your code (e.g. you need more speed), > you can use the type String_Access instead. > > You may well employ the following strategy: convert value(s) of type > Unbounded_String to type String_Access (using the To_String function and the > 'new' allocator); operate on the String_Access object(s) as required; > convert the result(s) back to type Unbounded_String (using the > To_Unbounded_String function). You don't need an access type for this (in Ada, you rarely need access types at all). You can simply operate on the String returned by To_String: declare Value : [constant] String := To_String (Unbounded_Value); begin -- Operate with/on Value Unbounded_Value := To_Unbounded_String (Value); -- if needed end; -- Jeff Carter "You couldn't catch clap in a brothel, silly English K...niggets." Monty Python & the Holy Grail