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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Ada 2005,Doubly_Linked_List with Controlled parameter Date: Mon, 4 Apr 2016 23:20:12 -0700 Organization: A noiseless patient Spider Message-ID: References: <1083384c-e798-49a0-903a-718dea4ab131@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 5 Apr 2016 06:16:58 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="48b46be33beed75863f69afa437f956b"; logging-data="11890"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191BLMLEadgJZApEkTDeG1Yxp5TRaJVkTM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <1083384c-e798-49a0-903a-718dea4ab131@googlegroups.com> Cancel-Lock: sha1:pJ6HjWOv0EKCH4YrBAv2jR1U+EI= Xref: news.eternal-september.org comp.lang.ada:29981 Date: 2016-04-04T23:20:12-07:00 List-Id: On 04/04/2016 08:00 PM, George J wrote: > > Ok,thanks,and if I correctly understood,if I have record with multiple parameters, i must do it like > --------------------------------- > type Info_Record is > Name:Unbounded_String;--ok > Surname:Unbounded_String; > Age:Natural; > end Info_Record; > -------------------------------- > Am I right? > And are they normally will be deleted from memory with finalization of Doubly_Connected_List? Yes. Your example, with only a single string, appeared to be an attempt to reinvent Unbounded_String, but if you need a type with multiple such values, this is a way to do it. "The type Unbounded_String needs finalization (see 7.6)." and "No storage associated with an Unbounded_String object shall be lost upon assignment or scope exit." ARM A.4.5 (http://www.adaic.org/resources/add_content/standards/05rm/html/RM-A-4-5.html). But I see you've discovered that already. (Some on here dislike Unbounded_String, but if it serves your purposes you should ignore them and use it. I worked on a large, soft-real-time system that used Unbounded_String extensively without problem, so such people's concerns seem to be unfounded.) -- Jeff Carter "Hold your temper. Count ten.... Now let 'er go. You got a good aim." Never Give a Sucker an Even Break 105