From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: tagged type as generic parameter
Date: Fri, 4 Jan 2008 15:17:10 +0100
Date: 2008-01-04T15:17:09+01:00 [thread overview]
Message-ID: <1c1nwyxkxc82o.1io2gzf0y091c$.dlg@40tude.net> (raw)
In-Reply-To: fllb25$a70$1@news2.u-psud.fr
On Fri, 04 Jan 2008 14:08:52 +0100, Philippe Tarroux wrote:
> Dmitry A. Kazakov a �crit :
>> The function A_Data returns Data. It is a primitive operation of Data and
>> thus covariant in the result. So when you derive anything from Data, you
>> have to override it in order to provide a correct implementation that would
>> return the derived type rather than the base.
>>
> Ok. But does it mean that only the constructor is a primitive operation
> of the data type, not the print procedure? In this case why Print
> doesn't need to be redefined?
Right, the reason why Print need not to be overridden is that it has Data
passed in the in-mode. So the caller has Data already constructed
elsewhere. For the same reason a procedure with an in-out-mode parameter
can be safely inherited too. Considering strictly out-mode parameters, it
could be otherwise, in general case. But in Ada tagged types have to be
constrained and constructed even when they are outs.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
prev parent reply other threads:[~2008-01-04 14:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-03 15:20 tagged type as generic parameter Philippe Tarroux
2008-01-03 15:51 ` Dmitry A. Kazakov
2008-01-03 16:22 ` Adam Beneschan
2008-01-03 16:58 ` Dmitry A. Kazakov
2008-01-03 17:47 ` Jean-Pierre Rosen
2008-01-03 18:13 ` Pascal Obry
2008-01-03 19:20 ` Dmitry A. Kazakov
2008-01-03 21:37 ` Jeffrey R. Carter
2008-01-04 13:08 ` Philippe Tarroux
2008-01-04 15:03 ` Jean-Pierre Rosen
2008-01-04 13:08 ` Philippe Tarroux
2008-01-04 13:22 ` Georg Bauhaus
2008-01-04 15:38 ` Philippe Tarroux
2008-01-04 14:17 ` Dmitry A. Kazakov [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox