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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8ca14c11fd6d2e56 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!pd7cy1no!shaw.ca!atl-c07.usenetserver.com!pc02.usenetserver.com!ALLTEL.NET-a2kHrUvQQWlmc!not-for-mail Date: Thu, 23 Jun 2005 12:47:25 -0500 From: "Marc A. Criley" User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: generic parameter Copy for primitifs types. References: <1119544911.159343.288010@g43g2000cwa.googlegroups.com> In-Reply-To: <1119544911.159343.288010@g43g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <94682$42baf5ad$4995788$19834@ALLTEL.NET> X-Complaints-To: abuse@usenetserver.com Organization: UseNetServer.com X-Trace: 9468242baf5ada13cf22d19834 Xref: g2news1.google.com comp.lang.ada:11598 Date: 2005-06-23T12:47:25-05:00 List-Id: nblanpain@hotmail.com wrote: > ----- > generic > type T_Item is private; > with procedure Copy (Left : in out T_Item; Right : in T_Item); > package Toto is > .... > end Toto; > ------ > > At instanciation, for T_Item = Integer for example, is there a methode > to take for Copy => ":=". Must I redefined Copy ? Can I say that, by > default, take ":=" ? No, you can't. The author of Toto presumably required the provision of a Copy procedure because what it's going to be doing may not be compatible with the default ":=". (Though perhaps T_Item should then have been declared as "limited private".) If a special Copy procedure wasn't needed, the implementation could've just used ":=", since that is allowed for non-limited private types. Even if the type you're supplying, e.g. Integer, would be fine with the built-in assignment, the package author would want to ensure that you had thought about it, and by writing a simple little function to do the copying, he ensures that. (Though I also think the "Left" parameter should probably be mode "out" rather than "in out".) Marc A. Criley www.mckae.com