comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: ANN: Ada 2005 Math Extensions, 20100810 release
Date: Fri, 13 Aug 2010 20:50:07 +0100
Date: 2010-08-13T20:50:07+01:00	[thread overview]
Message-ID: <m2d3tmwavk.fsf@pushface.org> (raw)
In-Reply-To: 15e1x67lls1pe$.sqnhbm59hwdz$.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> Yes, especially because of two "Extensions". I had immense problems with
> names. Look at this:
>
>    http://www.dmitry-kazakov.de/ada/fuzzy_packages.gif

Gosh!

From a UML background (OK, OK, ...) I'd have the arrows pointing the
other way ('depends on' rather than 'is used in' or 'supports').

> Somewhere down deep the hierarchy the user starts to become
> incomprehensive error messages upon instantiation within the
> generic(!) bodies. It is practically impossible to understand what is
> wrong, is it a compiler bug (in GNAT case) or something else. For the
> user it would be a nightmare to fight this.

I think I've come across a GNAT bug here .. I dont think it's allowed
for a generic to compile but the instantiation not!

> Another rule of thumb (I don't know if this is going to be fixed in
> Ada 2012), is that a child should always rename formal generic
> arguments in its specifications. Under certain circumstances, usually
> in children, they might become unavailable. I mean this:
>
> generic
>    with package P is new Generic_P (<>);
> package Generic_S is
>    package P_Of renames P; -- You will need this!
>
> Sometimes you need to "rename" formal types as well:
>
> generic
>    type Foo is ...
> package Generic_S is
>    subtype Foo_Of is Foo; -- What a mess!

I've more often come across the latter.

Could consider

generic
   type Formal_Foo is ...
package Generic_S is
   subtype Foo is Formal_Foo;




  parent reply	other threads:[~2010-08-13 19:50 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 21:38 ANN: Ada 2005 Math Extensions, 20100810 release Simon Wright
2010-08-11 11:40 ` Ada novice
2010-08-11 21:38 ` Simon Wright
2010-08-12  5:57   ` Dmitry A. Kazakov
2010-08-12 19:45     ` Simon Wright
2010-08-13  6:27       ` Dmitry A. Kazakov
2010-08-13  6:54         ` Ludovic Brenta
2010-08-13 13:36           ` Yannick Duchêne (Hibou57)
2010-08-13  7:42         ` Georg Bauhaus
2010-08-13  8:40           ` Dmitry A. Kazakov
2010-08-13 13:41             ` Yannick Duchêne (Hibou57)
2010-08-13 13:57               ` Dmitry A. Kazakov
2010-08-13 13:31         ` Yannick Duchêne (Hibou57)
2010-08-13 13:48           ` Dmitry A. Kazakov
2010-08-13 19:50         ` Simon Wright [this message]
2010-08-13 20:17           ` Yannick Duchêne (Hibou57)
2010-08-13 22:04             ` Simon Wright
2010-08-13 22:28               ` Yannick Duchêne (Hibou57)
2010-08-13 22:30                 ` Yannick Duchêne (Hibou57)
2010-08-14 16:12                 ` Simon Wright
2010-08-14 17:16                   ` Dmitry A. Kazakov
2010-08-14 17:34                     ` Jeffrey Carter
2010-08-14 19:18                       ` Simon Wright
2010-08-14 23:51                         ` Georg Bauhaus
2010-08-15  0:57                           ` Yannick Duchêne (Hibou57)
2010-08-15  2:27                           ` Jeffrey Carter
2010-08-12 10:36   ` Stephen Leake
2010-08-12 12:48     ` sjw
2010-08-14  1:05       ` Stephen Leake
2010-08-14 16:26         ` Simon Wright
2010-08-14 17:24           ` Dmitry A. Kazakov
2010-08-14 19:16             ` Simon Wright
2010-08-14 20:48               ` Dmitry A. Kazakov
2010-08-14 21:55                 ` Simon Wright
2010-08-15  6:14                   ` Dmitry A. Kazakov
2010-08-15 17:06                     ` Simon Wright
2010-08-15 18:18                       ` Dmitry A. Kazakov
replies disabled

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