comp.lang.ada
 help / color / mirror / Atom feed
From: "Hyman Rosen" <hyman.rosen@gmail.com>
Subject: Re: tagged record child: override constructor?
Date: 16 Sep 2005 14:33:45 -0700
Date: 2005-09-16T14:33:45-07:00	[thread overview]
Message-ID: <1126906425.359022.289440@g43g2000cwa.googlegroups.com> (raw)
In-Reply-To: 93g4w5iedrdj.qjv8pbklcryx$.dlg@40tude.net

Dmitry A. Kazakov wrote:
> Why do you think so? The program semantics should be independent from the
> parameter passing mode.

If tagged types were not passed by reference then the program
semantics would be severely affected. That's why the language
requires that passing mode. But in that case, it should be part
of the program, not a hidden requirement.

> You cannot have a reference to a specific type. Same with pointers.

True (for class types).

> Further, because
> T& is not an object, you cannot do such elementary thing as to copy a
> polymorphic object.

No, that's not why. It's purely the pragmatic implementation
complexity of arranging for the space and copying of an object
of runtime-determined size. Even in Ada objects of T'Class type
are somewhat half-baked. They can't live inside records, you
can't have arrays of them, etc.

> No. It is the class rooted in the type which do. A T'Class serves as a
> closure of all types derived from T.
> A view conversion is still a conversion.

When I view convert from a derived class type to a base class type,
and then back again, I have the same contents (and the same object)
that I started with. The extra derived stuff cannot magically appear
from nowhere; therefore it must have been there all along. Therefore
even though I have an object of some declared type I know that it may
be carrying along a bunch of extra data.




  reply	other threads:[~2005-09-16 21:33 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13  5:58 tagged record child: override constructor? sean.gilbertson
2005-09-13  6:39 ` David Trudgett
2005-09-13  7:32 ` Dmitry A. Kazakov
2005-09-13  7:56   ` tmoran
2005-09-13 15:23   ` sean.gilbertson
2005-09-13 17:37     ` Martin Krischik
2005-09-13 19:29       ` Ludovic Brenta
2005-09-14  7:49         ` Dmitry A. Kazakov
2005-09-14  9:05           ` Maciej Sobczak
2005-09-14 13:20             ` Dmitry A. Kazakov
2005-09-14 13:52               ` Hyman Rosen
2005-09-14 16:47                 ` Dmitry A. Kazakov
2005-09-14 17:16                   ` Hyman Rosen
2005-09-14 20:20                     ` Dmitry A. Kazakov
2005-09-14 20:34                       ` Georg Bauhaus
2005-09-14 20:56                       ` Hyman Rosen
2005-09-15  7:31                         ` Dmitry A. Kazakov
2005-09-15 13:19                           ` Hyman Rosen
2005-09-15 13:45                             ` Maciej Sobczak
2005-09-15 17:45                             ` Dmitry A. Kazakov
2005-09-15 18:54                               ` Hyman Rosen
2005-09-16  9:32                                 ` Dmitry A. Kazakov
2005-09-16 14:52                                   ` Hyman Rosen
2005-09-16 15:33                                     ` Jean-Pierre Rosen
2005-09-16 18:37                                       ` Hyman Rosen
2005-09-16 21:03                                     ` Dmitry A. Kazakov
2005-09-16 21:33                                       ` Hyman Rosen [this message]
     [not found]                                         ` <98ox2x9xvj9z.1uh92dslhvt4g.dlg@40tude.net>
2005-09-17 12:47                                           ` Georg Bauhaus
2005-09-17 15:56                                             ` Dmitry A. Kazakov
2005-09-14 16:14           ` Martin Krischik
2005-09-14 16:57             ` Dmitry A. Kazakov
2005-09-14 18:35               ` Martin Krischik
2005-09-14  9:28         ` Alex R. Mosteo
2005-09-14 16:10         ` Martin Krischik
2005-09-13  9:33 ` Georg Bauhaus
2005-09-13 16:37 ` Jeffrey Carter
2005-09-13 18:55   ` Robert A Duff
2005-09-13 22:18     ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox