comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: What is wrong here? (Generic and controlled types)
Date: 2000/04/06
Date: 2000-04-06T00:00:00+00:00	[thread overview]
Message-ID: <8ci9g2$u9l$1@nnrp1.deja.com> (raw)
In-Reply-To: 8catei$n8$1@slb6.atl.mindspring.net

In article <8catei$n8$1@slb6.atl.mindspring.net>,
  swhalen@netcom.com wrote:
> Robert Dewar <robert_dewar@my-deja.com> wrote:
> : 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.
>
> : P.S. it is hard to see how the GNAT message could be any
> : clearer, suggestions welcome!
>
> 29.    package Real_Vectors is new Generic_Vectors(Real,
Index, Zero);
>        |
>     >>> instantiation error at generic_vectors.ads:23
>     >>> controlled type must be declared at the library level
>     >>>   (consider including controlled component instead
>     >>>    of making entire type controlled?)
>
> I know I'd appreciate getting a helpful hint like this, even
> though I have no reason to expect the compiler to do so.


For me that's going too far, since most often the solution is
simply to avoid the nesting that is causing the trouble, and
there are dozens of other possible solutions. TO fix on this
one would be misleading more often than not.

Yes, it would be nice if compilers could help write your
program for you, and they do try to help a bit, but if they
go too far in this direction, they start becoming actively
unhelpful. Finding just the right balance is not always easy.

Generally we avoid programming advice in messages unless it
is VERY likely to be correct, e.g. it is almost certainly
right to suggest adding ALL to make an access type general
when aliased is used incorrectly with a pool specific
access type


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




  reply	other threads:[~2000-04-06  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   ` Ehud Lamm
2000-04-03  0:00   ` Robert Dewar
2000-04-03  0:00     ` swhalen
2000-04-06  0:00       ` Robert Dewar [this message]
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     ` Ted Dennison
2000-04-04  0:00     ` Robert A Duff
2000-04-06  0:00       ` Robert Dewar
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-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-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