comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: What is wrong here? (Generic and controlled types)
Date: 2000/04/03
Date: 2000-04-03T00:00:00+00:00	[thread overview]
Message-ID: <8capmt$kgk$1@nnrp1.deja.com> (raw)
In-Reply-To: 8cahmn$apq$1@nnrp1.deja.com

In article <8cahmn$apq$1@nnrp1.deja.com>,
Robert Dewar <robert_dewar@my-deja.com> wrote:
> In article <8caebe$6us$1@nnrp1.deja.com>,
> Ted Dennison <dennison@telepath.com> wrote:
>
> > I personally feel Ada really falls on its face here. The only
> > time I ever felt I needed to create a controlled type was in
> > this context.
>
> It is almost always possible to work around this trivially by
> simply including a controlled component in the type instead
> of making the entire type controlled.

You've said this before, and I still don't quite understand what you are
getting at. I see two possibilites. One is that you saying that people
who do this are almost always trying to control fields they don't need
to control. Thus they could just put off the fields they *do* need
to control into some subrecord defined at a higher level. I wouldn't
call that a workaround. That's simply proper design. *Given* that the
design is proper, such a solution will help in exactly %0 of the time
the problem comes up.

The other possibility is that there is some other subfield technique
that I'm missing and can't puzzle out for myself. The only way for a
controlled subrecord to modify its parent record when one of the
controlled operations occurs is for it to have some kind of field that
refers back to the parent record. This requires knowledge of the
structure of that parent record. But such knowledge cannot exist until
that parent record is declared. The definition of the subrecord and/or
the overloading of the controlled operations needs to have visibility to
that parent record. That requires that the controlled subrecord be
declared at a level no higher than the parent record. So now we have the
exact same problem: The subrecord type must be declared at the library
level because its derived from controlled, but it must be declared at a
lower level if the type it refers to is declared at a lower level.

--
T.E.D.
http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~2000-04-03  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-03  0:00 What is wrong here? (Generic and controlled types) Alexander Boucke
2000-04-03  0:00 ` Ted Dennison
2000-04-03  0:00   ` Robert Dewar
2000-04-03  0:00     ` Florian Weimer
2000-04-03  0:00       ` tmoran
2000-04-04  0:00       ` Alexander Boucke
2000-04-06  0:00       ` Robert Dewar
2000-04-21  0:00         ` Florian Weimer
2000-04-03  0:00     ` swhalen
2000-04-06  0:00       ` Robert Dewar
2000-04-03  0:00     ` Ted Dennison [this message]
2000-04-04  0:00     ` Robert A Duff
2000-04-06  0:00       ` Mats Weber
2000-04-06  0:00         ` Robert Dewar
2000-04-06  0:00           ` Robert A Duff
2000-04-06  0:00             ` Robert Dewar
2000-04-06  0:00       ` Robert Dewar
2000-04-21  0:00     ` Vincent Marciante
2000-04-21  0:00       ` Robert Dewar
2000-04-21  0:00         ` Robert Dewar
2000-04-22  0:00         ` Vincent Marciante
2000-04-22  0:00           ` Robert Dewar
2000-04-03  0:00   ` Ehud Lamm
2000-04-04  0:00   ` Alexander Boucke
2000-04-06  0:00     ` Robert Dewar
replies disabled

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