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!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Help with type definition Date: Fri, 16 May 2014 10:57:29 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <8beec1c1-9ca2-44fc-9d7e-0cd0aa772dcc@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 16 May 2014 17:57:31 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="42ea65963a295dd28559459f9f96c6a5"; logging-data="10881"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EXVBxR0Ebetl8uPd0SX0629P+IQ69EOE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <8beec1c1-9ca2-44fc-9d7e-0cd0aa772dcc@googlegroups.com> Cancel-Lock: sha1:cNl/AioYsBMYUagYh2g5wPoR7Zw= Xref: news.eternal-september.org comp.lang.ada:19867 Date: 2014-05-16T10:57:29-07:00 List-Id: On 05/16/2014 12:37 AM, hanslad@gmail.com wrote: > > type String_Type_Implementation(Count : Natural) is record > Data : String(1 .. Count) := ""; > end record; > > type String_Type_Implementation_Ptr is access String_Type_Implementation; > > type String_Type is new Ada.Finalization.Controlled with record > Length : Integer; > Implementation : String_Type_Implementation_Ptr; > end record; String_Type is not suitable for sending over the network, so why not simply use Ada.Strings.Unbounded.Unbounded_String for the string value in type Node? You're going to have to construct the sequence of bytes to go over the network in either case. A consistent coding and naming style, and a lot fewer occurrences of the sequence [t|T]ype would make your code easier to read. -- Jeff Carter "Hold your temper. Count ten.... Now let 'er go. You got a good aim." Never Give a Sucker an Even Break 105