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.189.194 with SMTP id gk2mr16437435pbc.3.1324296711854; Mon, 19 Dec 2011 04:11:51 -0800 (PST) Path: lh20ni40312pbb.0!nntp.google.com!news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: String_Holder ? Date: Mon, 19 Dec 2011 14:14:18 +0200 Organization: Tidorum Ltd Message-ID: <9l8o06Fh7jU1@mid.individual.net> References: Mime-Version: 1.0 X-Trace: individual.net kOffDvRuYBEB+QGdQy2CUgt3PEfLp4q/goni7ZlCdHDVyhgjBd Cancel-Lock: sha1:0yzVZIfA5KO2ndPM1jTHVsptj9Y= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-12-19T14:14:18+02:00 List-Id: On 11-12-19 01:08 , Natasha Kerensikova wrote: > Hello, > > On 2011-12-18, Jeffrey Carter wrote: >> On 12/18/2011 05:34 AM, Natasha Kerensikova wrote: >>> 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. > > Mostly having the type named after the function of objects in the > project rather than characteristics of the objects. That is a good aim. You can reach it by deriving a type with the name you want: type Goblin_Name is new Ada.Strings.Unbounded_String; type ... is record ... Goblin : Goblin_Name; ... end record; > Also allowing to > replace it more easily later on with an implementation better suited to > the function in a particular project, should the need ever arise. Simple, just change the derivation, one place, one change. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .