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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c6aaff9993e444f0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.212.232 with SMTP id nn8mr14814702pbc.1.1324241732182; Sun, 18 Dec 2011 12:55:32 -0800 (PST) Path: lh20ni37918pbb.0!nntp.google.com!news1.google.com!news.glorb.com!news.netfront.net!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: String_Holder ? Date: Sun, 18 Dec 2011 13:55:29 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: NNTP-Posting-Host: 97.214.12.59 Mime-Version: 1.0 X-Trace: adenine.netfront.net 1324241731 66189 97.214.12.59 (18 Dec 2011 20:55:31 GMT) X-Complaints-To: news@netfront.net NNTP-Posting-Date: Sun, 18 Dec 2011 20:55:31 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-12-18T13:55:29-07:00 List-Id: On 12/18/2011 05:34 AM, Natasha Kerensikova wrote: > > in my few Ada projects so far, I have quite often encountered the need > of storing a string along with other information in records. So I went > for discriminants containing the string size, and putting the string > directly in the record. > > This works well when there is only one or two strings, but with several > of them, or in variant records, I find it quite heavy. So I was thinking > about something like that: > > > type String_Holder is still to be defined; > > function Hold (S : String) return String_Holder; > > function To_String (Holder : String_Holder) return String; > > procedure Query (Holder : String_Holder; > Process : not null access procedure (S : String)); I see no advantage to this over Unbounded_String. -- Jeff Carter "Many times we're given rhymes that are quite unsingable." Monty Python and the Holy Grail 57 --- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---