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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!62.141.58.147.MISMATCH!newsfeed.keyweb.org!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: generic parameter Copy for primitifs types. Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1119544911.159343.288010@g43g2000cwa.googlegroups.com> Date: Thu, 23 Jun 2005 19:54:39 +0200 Message-ID: <837ivwsz8r2d$.j16zz1529zb9$.dlg@40tude.net> NNTP-Posting-Date: 23 Jun 2005 19:54:26 MEST NNTP-Posting-Host: 78fdd7f8.newsread2.arcor-online.net X-Trace: DXC=;a3OO?dBTj_fnCoe<@CEZ^Q5U85hF6f;TjW\KbG]kaMXXSE8@R32<>f3dFYZKH7?S1@>cRY X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:11599 Date: 2005-06-23T19:54:26+02:00 List-Id: On 23 Jun 2005 09:41:51 -0700, nblanpain@hotmail.com wrote: > this is my problem : > > ----- > 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, for good or bad, but ":=" is not a procedure in Ada. One point, the formal generic parameter T_Item is declared as "private". This means that its actual counterpart must have assignment. So you can write: generic type T_Item is private; package Toto is ... end Toto; and use assignment within the body of Toto: package body Toto is ... X, Y : T_Item; begin ... X := Y; ... end Toto; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de