comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Constructing an object
Date: Thu, 29 Sep 2005 17:21:08 -0500
Date: 2005-09-29T17:21:08-05:00	[thread overview]
Message-ID: <vNWdnUoV7Ptv-qHeRVn-vw@megapath.net> (raw)
In-Reply-To: 88m4nn9wh78b$.1wtlfwjymgcom.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:88m4nn9wh78b$.1wtlfwjymgcom.dlg@40tude.net...
> On Wed, 28 Sep 2005 19:12:40 -0500, Randy Brukardt wrote:
...
> This way, I believe, we could have constructors with arbitrary parameters
> for all types.

Interesting. I don't think that would work for Ada as it is currently
defined, because we tried to do something like that in the implementation of
the Janus/Ada compiler and it didn't work. I believe the problems had to do
with composition (that is, calling the functions for the inner components of
a record whose constraints depend on the outer constraints). But I don't
remember all of the details.
...
> >> Further, Ada needs extensible primitive and
> >> class-wide operations, that could finally solve the construction /
> >> assignment problem.
> >
> > I have no idea what this means; Ada has extensible primitive operations
> > (indeed, *only* primitive operations can be extended).
>
> They aren't extensible in the sense that you can only override or inherit.
> It is too dangerous for constructors and assignments. BTW, Ada does not to
> completely override them anyway. For example the parts responsible for
> initialization of the components cannot be overridden. One cannot have a
> task component which will not start because Initialize does not call the
> parent's one! (:-))

Ah, I see. Certainly you are right here. I see that a lot in Finalize
routines; it is real easy to forget to call the Finalize for the parent
type. There ought to be a better way of extending rather than replacing
routines; that's especially true since requires an explicit type conversion
to the parent to make that call, and it is easy to get wrong (and go
infinitely recursive).

No one proposed anything that would work, though. My syntax proposal (which
predated the current generic_dispatching_constructor) tried to include that
functionality, but it would have been a band-aid at best. This issue was
never as high on the radar as others (like the user-defined T'Class'Input
problem), so it didn't get handled.

                                  Randy.






  reply	other threads:[~2005-09-29 22:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21  8:46 Constructing an object Maciej Sobczak
2005-09-21 10:16 ` Georg Bauhaus
2005-09-22  7:21   ` Maciej Sobczak
2005-09-21 11:55 ` Dmitry A. Kazakov
2005-09-22  7:28   ` Maciej Sobczak
2005-09-22  7:45     ` Maciej Sobczak
2005-09-22 13:33       ` Dmitry A. Kazakov
2005-09-24  5:23         ` Randy Brukardt
2005-09-24  9:47           ` Dmitry A. Kazakov
2005-09-29  0:12             ` Randy Brukardt
2005-09-29  8:17               ` Dmitry A. Kazakov
2005-09-29 22:21                 ` Randy Brukardt [this message]
2005-09-30  8:14                   ` Jean-Pierre Rosen
2005-09-30 19:28                     ` Dmitry A. Kazakov
2005-09-30 17:49                   ` Robert A Duff
2005-10-01  0:44                     ` Randy Brukardt
2005-10-01 10:49                       ` Dmitry A. Kazakov
2005-10-01 11:06                       ` Tapio Kelloniemi
2005-10-01 14:13                         ` Robert A Duff
2005-10-02 11:52                           ` Tapio Kelloniemi
2005-10-01 15:19                       ` Georg Bauhaus
2005-09-23  5:40 ` Matthew Heaney
2005-09-23  7:18   ` tmoran
2005-09-23  8:23   ` Maciej Sobczak
2005-09-23 12:04     ` Dmitry A. Kazakov
2005-09-23 12:36       ` Matthew Heaney
2005-09-23 13:03         ` Hyman Rosen
2005-09-23 13:41           ` Maciej Sobczak
2005-09-23 14:23           ` Matthew Heaney
2006-01-17  6:28             ` [Offtopic] " James Dennett
2005-09-23 13:42         ` Dmitry A. Kazakov
2005-09-23 14:27           ` Matthew Heaney
2005-09-23 12:24     ` Matthew Heaney
2005-09-24  5:34       ` Randy Brukardt
replies disabled

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