comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Generic package parameters not externally visible : what's the rational ?
Date: Thu, 5 Nov 2009 02:38:46 -0800 (PST)
Date: 2009-11-05T02:38:46-08:00	[thread overview]
Message-ID: <67b00f8a-3d12-48c9-ad5a-34980cf82e08@37g2000yqm.googlegroups.com> (raw)
In-Reply-To: 1ueb9d0h9nmm3$.11lt1wv42yxvt.dlg@40tude.net

On 3 nov, 10:59, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> > Generic package hierarchy is nicer than I previously supposed
>
> Yes, but beware that there are *three* hierarchies:
>
> 1. one of the generic packages
> 2. of the instances of generic packages (you can instantiate a generic
> child of generic A as a non-generic child of non-generic B)
> 3. of nested packages (you can instantiate within a package)
>
> A creative use of 1-3 may create a perfect mess out of your program...
I was not really sure about the meaning of “ mess out ” (the term you
used), now I suppose this may mean “ real mess ”, and here is why.

I see at least three productive enough mess seeds with generic child
hierarchy (from the less to the most nasty)
1) The implicit with which comes with all child packages, generic or
not (I had never really enjoyed this implicit With).
2) The miss-match between the generic Withed path and the actual
instance matching path
3) The naming nightmare which comes while creating the instance
hierarchy

With more details :
1) Dependencies are clearly explicit with classic packages, this is no
more the case with child packages. I know this is the same with non-
generic, but this is not really welcome to me (I sometime dream about
child packages hierarchy which would require explicit With).
2) Let A, a generic package, B, a generic child of A, C, an instance
of A, then instantiating C.B requires to With A.B. I understand why it
is this way (although this could have been another way too), but an
A.B whose A actually and implicitly match C, does not help to be
clear.
3) The one I really do not like : with same packages as in #2,
instantiating A.B as a child of C, requires to use a new name which
cannot be B, and if the name B is the most natural one in the context
of A, this mostly mean this would be the same in the context of C,
thus the naming nightmare. For the purpose of the comment which will
follows right after, let call it D.

To reword what you were saying, there is indeed three hierarchies and
not two : the source generic hierarchy (like A.B), the instance
hierarchy (like C.D) and beside this instance hierarchy, another
implicit generic hierarchy (like C.B), and this is hard to deal with.

Yes, now I'm sure you were really talking about mess.

#3 may be solved using a standard prefix for all generics, like
Generic_, but I do not like it, because this easily ends in too much
long paths. Now I'm seeking for a more clever way to easily handle
this three-hierarchies structure. This would not Solve #2 any way.

(Hope I was Ok to post these comments here)



  reply	other threads:[~2009-11-05 10:38 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26  8:58 Generic package parameters not externally visible : what's the rational ? Hibou57 (Yannick Duchêne)
2009-10-26 11:05 ` Ludovic Brenta
2009-10-26 15:02   ` Robert A Duff
2009-10-27  1:06   ` Hibou57 (Yannick Duchêne)
2009-10-26 14:56 ` Robert A Duff
2009-10-27  3:03   ` Hibou57 (Yannick Duchêne)
2009-10-27 21:08   ` Randy Brukardt
2009-10-27 21:36     ` Jeffrey R. Carter
2009-10-27 22:03       ` Hibou57 (Yannick Duchêne)
2009-10-27 22:19         ` Jeffrey R. Carter
2009-10-28 19:07         ` Randy Brukardt
2009-10-29 12:18           ` Hibou57 (Yannick Duchêne)
2009-10-29 22:56             ` Randy Brukardt
2009-10-30  0:10               ` Hibou57 (Yannick Duchêne)
2009-10-27 22:04       ` Hibou57 (Yannick Duchêne)
2009-10-27 23:37       ` Robert A Duff
2009-10-27 23:41         ` Jeffrey R. Carter
2009-10-27 23:34     ` Robert A Duff
2009-10-28  2:19       ` Hibou57 (Yannick Duchêne)
2009-10-28 19:12         ` Randy Brukardt
2009-10-29  7:34           ` Stephen Leake
2009-10-29 12:21           ` Hibou57 (Yannick Duchêne)
2009-10-29 13:10             ` AdaMagica
2009-10-29 15:11               ` Georg Bauhaus
2009-10-29 19:28                 ` Jeffrey R. Carter
2009-10-29 20:27                   ` Georg Bauhaus
2009-10-30 10:30               ` Stephen Leake
2009-10-30 17:53             ` Ludovic Brenta
2009-10-31  2:10               ` Hibou57 (Yannick Duchêne)
2009-10-30  5:19           ` Hibou57 (Yannick Duchêne)
2009-10-28  9:09     ` Dmitry A. Kazakov
2009-10-28 19:19       ` Randy Brukardt
2009-10-29  8:36         ` Dmitry A. Kazakov
2009-10-29 23:03           ` Randy Brukardt
2009-10-30  8:51             ` Dmitry A. Kazakov
2009-10-30 10:25           ` Stephen Leake
2009-10-30 19:32             ` Dmitry A. Kazakov
2009-10-31  2:06               ` Hibou57 (Yannick Duchêne)
2009-10-31  9:14                 ` Dmitry A. Kazakov
2009-11-03  8:25                   ` Hibou57 (Yannick Duchêne)
2009-11-03  9:59                     ` Dmitry A. Kazakov
2009-11-05 10:38                       ` Hibou57 (Yannick Duchêne) [this message]
2009-11-05 11:00                         ` Dmitry A. Kazakov
2009-11-05 12:16                           ` Hibou57 (Yannick Duchêne)
2009-11-05 14:09                             ` Dmitry A. Kazakov
2009-11-06 12:19                               ` Hibou57 (Yannick Duchêne)
2009-11-06 13:27                                 ` Dmitry A. Kazakov
2009-10-31  2:08               ` Hibou57 (Yannick Duchêne)
2009-10-31 12:44               ` Stephen Leake
2009-11-01 11:37                 ` 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