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: Tue, 27 Oct 2009 19:19:43 -0700 (PDT)
Date: 2009-10-27T19:19:43-07:00	[thread overview]
Message-ID: <b6d32b60-333f-495d-b17a-7ab589690bbb@d10g2000yqh.googlegroups.com> (raw)
In-Reply-To: wccaazcxvgn.fsf@shell01.TheWorld.com

On 27 oct, 23:19, "Jeffrey R. Carter" <spam.jrcarter....@spam.acm.org>
wrote:
> Then C clearly has a dependency on this 4th pkg (shall we call it D?), and that
> dependency should be made explicit, by including "with D;" on C.
While both origin are equally legitimate, and this is not only the
case with generics.
This make me thing its the same kind of type matching by name (or
declaration) and type matching by structure. Here, we could say than
the origin means something. As a concrete image, let say the type in
its first declaration place, has some comments attached to it. Ok.
Then, a package as a formal parameter, with some comments attached to
this parameters. Then, the parameters is associated to the defined
type. Here, the presence of comments stands for a meaning, and the
fact that some comment may be associated to the type at the place
where it is a formal parameter, shows that using one or the other
origin, may not means the same thing. If I refer to A.C, this may not
mean the same as if I refer to B.C, even if C is the same in both
place. After all, the generic parameter of a package, is one location,
a fixed location, and the type used to instantiate the package, may
not be so much clearly fixed (I apologize if my word does not seems
very clear, I'm trying to express a though). If I refer to A.C, I mean
something, if I refer to B.C, I may mean something else, and the
difference may have multiple cause (clarity, logic, requirement,
style, etc).

I take long to talk about and does not hesitate to say a lot about
details, because I'm currently thinking about what conventions I
should use, what patterns and overall strategies for this and that.
And I would like to work at it the sooner, rather than to have to come
back to it too much late (I'm testing on a little sample application
with about 40 small packages, most of which are generics, and spend a
lot of time to rewrite this and that, re-read all to see if it seems
accessible and readable, easy to use, well glued, etc).

> But Ada allows a generic to reference the unknown generic parameters of its
> formal package parameters. See ARM 12.7.
I did not knew about it, I will look at it tomorrow. Thanks for the
point.

On 28 oct, 00:34, Robert A Duff <bobd...@shell01.TheWorld.com> wrote:
> > Indeed, I find that it makes "perfect sense" for them not the visible: they
> > are not part of the package that gets instantiated. That's clear from the
> > syntax (they're outside the package).
>
> I've always found that syntax odd, for what it's worth.
> Part of the declarative region of the generic package
> comes before its name.
The same for me, I have never really feel at ease with this package
name not coming at the first place (probably another thing from the
beginning of the long history of Ada).

About the previous assertion, saying “ they are not part of the
package that gets instantiated ”, I sincerely do not understand this
assertion. Where are they if they are not part of the package ? If
they are given as parameters, they are injected in the package.

But right a few minutes ago, I was thinking that is may be finally
better to be able to hide something there. Perhaps peoples who were
talking about protecting type privacy, were thinking about a formal
parameter used in the private part of the package only. When it is
(this may not always be so much strange as it seems, to give formals
parameters which are only used in private part), it is better to not
make these visible from the outside. Providing this is a good answer,
then the actual is so just the best, because it allow to show or hide
at the discretion of the author (the language does not impose anything
there, except it hides by default, and that's finally a good fact).



  reply	other threads:[~2009-10-28  2:19 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) [this message]
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)
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