Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If God had a beard, he'd be a UNIX programmer.


devel / comp.lang.ada / Re: [Ada95] Private non-generic children of generics not allowed

SubjectAuthor
* [Ada95] Private non-generic children of generics not allowedVincent Marciante
+* Re: [Ada95] Private non-generic children of generics not allowedAdaMagica
|`* Re: [Ada95] Private non-generic children of generics not allowedVincent Marciante
| `* Re: [Ada95] Private non-generic children of generics not allowedAdaMagica
|  `* Re: [Ada95] Private non-generic children of generics not allowedVincent Marciante
|   `- Re: [Ada95] Private non-generic children of generics not allowedAdaMagica
`* Re: [Ada95] Private non-generic children of generics not allowedAdaMagica
 `* Re: [Ada95] Private non-generic children of generics not allowedVincent Marciante
  `* Re: [Ada95] Private non-generic children of generics not allowedEgil H H
   `* Re: [Ada95] Private non-generic children of generics not allowedVincent Marciante
    `* Re: [Ada95] Private non-generic children of generics not allowedAdaMagica
     `* Re: [Ada95] Private non-generic children of generics not allowedVincent Marciante
      `* Re: [Ada95] Private non-generic children of generics not allowedAdaMagica
       `* Re: [Ada95] Private non-generic children of generics not allowedThomas
        `- Re: [Ada95] Private non-generic children of generics not allowedIndra Anita

1
[Ada95] Private non-generic children of generics not allowed

<78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5115&group=comp.lang.ada#5115

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:4d43:: with SMTP id x3mr17609850qtv.326.1619451814581;
Mon, 26 Apr 2021 08:43:34 -0700 (PDT)
X-Received: by 2002:a25:6d02:: with SMTP id i2mr25997800ybc.309.1619451814401;
Mon, 26 Apr 2021 08:43:34 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 26 Apr 2021 08:43:34 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=35.245.252.196; posting-account=XfA3zgkAAABoz6fRf3Tehtnqqr7Ycml-
NNTP-Posting-Host: 35.245.252.196
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
Subject: [Ada95] Private non-generic children of generics not allowed
From: vincent....@l3harris.com (Vincent Marciante)
Injection-Date: Mon, 26 Apr 2021 15:43:34 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Vincent Marciante - Mon, 26 Apr 2021 15:43 UTC

[Repost with proper title]

I pretty much follow the rational requiring children of generics that are
meant to be used by users of a generic also be generic. But what about
the case that the child is only introduced for "separation of concerns"
and "information hiding" in the body of a generic package: Why can't
_private_ children of a generic _always_ for use only in the implementation of the parent unit be allowed? That seems to me to be only a little more flexible version of the allowed arrangement where the desired
functionality is expressed in a body-local package that has _its_ implementation as separate stub.

So, I mean I have a situation where I like to be able to do the following
but can't.

generic
....
package Generic_Package is
procedure Parent_Procedure;
....
end;
private
package Generi
_Package.Child is
procedure GPC_Procedure;
....
end;

package body Generic_Package is
....
procedure Parent_Procedure is separate;
....
end;
with Generic_Package.C
hild;
separate (Generic_Package)
procedure Parent_Procedure is
begin
....
Generic_Package.Child.GPC_Procedure;
....
end;

Re: [Ada95] Private non-generic children of generics not allowed

<77699289-3e50-4fae-a416-8ce11965f368n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5116&group=comp.lang.ada#5116

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:4455:: with SMTP id m21mr6326350qtn.192.1619455306939;
Mon, 26 Apr 2021 09:41:46 -0700 (PDT)
X-Received: by 2002:a5b:448:: with SMTP id s8mr25913476ybp.363.1619455306760;
Mon, 26 Apr 2021 09:41:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 26 Apr 2021 09:41:46 -0700 (PDT)
In-Reply-To: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.102.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.102.170
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <77699289-3e50-4fae-a416-8ce11965f368n@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Mon, 26 Apr 2021 16:41:46 +0000
Content-Type: text/plain; charset="UTF-8"
 by: AdaMagica - Mon, 26 Apr 2021 16:41 UTC

Children of generic packages are also generic.

generic
package P is
end P;

generic
package P.C is
end P.C;

private generic
package P.R is
end P.R;

Problem with private children is that they are not there for the client. Thus they can only be instantiated within another package:

package body P.C is
package Inst is new P.R;
end P.C;

Re: [Ada95] Private non-generic children of generics not allowed

<984f3661-59bb-4c09-a686-d456979c54a7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5117&group=comp.lang.ada#5117

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a0c:bd2b:: with SMTP id m43mr12086861qvg.52.1619455988844;
Mon, 26 Apr 2021 09:53:08 -0700 (PDT)
X-Received: by 2002:a25:3816:: with SMTP id f22mr11286685yba.405.1619455988654;
Mon, 26 Apr 2021 09:53:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 26 Apr 2021 09:53:08 -0700 (PDT)
In-Reply-To: <77699289-3e50-4fae-a416-8ce11965f368n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=35.245.252.196; posting-account=XfA3zgkAAABoz6fRf3Tehtnqqr7Ycml-
NNTP-Posting-Host: 35.245.252.196
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com> <77699289-3e50-4fae-a416-8ce11965f368n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <984f3661-59bb-4c09-a686-d456979c54a7n@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: vincent....@l3harris.com (Vincent Marciante)
Injection-Date: Mon, 26 Apr 2021 16:53:08 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Vincent Marciante - Mon, 26 Apr 2021 16:53 UTC

On Monday, April 26, 2021 at 12:41:47 PM UTC-4, AdaMagica wrote:
> Children of generic packages are also generic.

I do understand that that is the current stipulation. My question is rational
for including the private children. It seems that a child arrangement such as
I presented (non-generic but _private_) would not have caused any problems
and might have been allowable. So, why not?

Re: [Ada95] Private non-generic children of generics not allowed

<e5538816-83ed-4fbb-bcc3-6051a5482c6en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5118&group=comp.lang.ada#5118

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ad4:4503:: with SMTP id k3mr2995919qvu.52.1619457385392;
Mon, 26 Apr 2021 10:16:25 -0700 (PDT)
X-Received: by 2002:a25:7354:: with SMTP id o81mr16657674ybc.165.1619457385232;
Mon, 26 Apr 2021 10:16:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 26 Apr 2021 10:16:25 -0700 (PDT)
In-Reply-To: <984f3661-59bb-4c09-a686-d456979c54a7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.102.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.102.170
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<77699289-3e50-4fae-a416-8ce11965f368n@googlegroups.com> <984f3661-59bb-4c09-a686-d456979c54a7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e5538816-83ed-4fbb-bcc3-6051a5482c6en@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Mon, 26 Apr 2021 17:16:25 +0000
Content-Type: text/plain; charset="UTF-8"
 by: AdaMagica - Mon, 26 Apr 2021 17:16 UTC

Vincent Marciante schrieb am Montag, 26. April 2021 um 18:53:09 UTC+2:
> On Monday, April 26, 2021 at 12:41:47 PM UTC-4, AdaMagica wrote:
> > Children of generic packages are also generic.
> I do understand that that is the current stipulation. My question is rational
> for including the private children. It seems that a child arrangement such as
> I presented (non-generic but _private_) would not have caused any problems
> and might have been allowable. So, why not?

Generic packages are not packages. So a child of a generic package cannot be a package. This is the logic.
I do not know what rules would have to be defined for making this allowed.

Re: [Ada95] Private non-generic children of generics not allowed

<6015b52f-992e-48ce-a9b8-11d7a02bfa63n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5130&group=comp.lang.ada#5130

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:1309:: with SMTP id v9mr1138361qtk.133.1619611762403;
Wed, 28 Apr 2021 05:09:22 -0700 (PDT)
X-Received: by 2002:a25:6643:: with SMTP id z3mr10940927ybm.165.1619611762204;
Wed, 28 Apr 2021 05:09:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 28 Apr 2021 05:09:22 -0700 (PDT)
In-Reply-To: <e5538816-83ed-4fbb-bcc3-6051a5482c6en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=35.245.252.196; posting-account=XfA3zgkAAABoz6fRf3Tehtnqqr7Ycml-
NNTP-Posting-Host: 35.245.252.196
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<77699289-3e50-4fae-a416-8ce11965f368n@googlegroups.com> <984f3661-59bb-4c09-a686-d456979c54a7n@googlegroups.com>
<e5538816-83ed-4fbb-bcc3-6051a5482c6en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6015b52f-992e-48ce-a9b8-11d7a02bfa63n@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: vincent....@l3harris.com (Vincent Marciante)
Injection-Date: Wed, 28 Apr 2021 12:09:22 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Vincent Marciante - Wed, 28 Apr 2021 12:09 UTC

On Monday, April 26, 2021 at 1:16:26 PM UTC-4, AdaMagica wrote:
> Vincent Marciante schrieb am Montag, 26. April 2021 um 18:53:09 UTC+2:
> > On Monday, April 26, 2021 at 12:41:47 PM UTC-4, AdaMagica wrote:
> > > Children of generic packages are also generic.
> > I do understand that that is the current stipulation. My question is rational
> > for including the private children. It seems that a child arrangement such as
> > I presented (non-generic but _private_) would not have caused any problems
> > and might have been allowable. So, why not?
> Generic packages are not packages. So a child of a generic package cannot be a package. This is the logic.
> I do not know what rules would have to be defined for making this allowed.

Considering private children of generic to be "per instance" would allow the body of
a generic to be less cluttered - not having to textually contain the spec of the child
and would allow more flexible/restrictable visibility: any (separate) unit that needs
to see the private child unit (and only those units) could then "with" the unit.

Currently, one would have to make the private child unit generic and then instantiate
it in the body of the parent at a place were all subunits that require its use can see it,
however, that might cause either (1) a less-than-preferable ordering of units in the body
or (2) more-than desired visibility of the unit.

Because the above can be done and ends up being very similar to the/my desired
arrangement (with the added costs described previously) why not arrange to allow
private non-generic children of a generic?

Re: [Ada95] Private non-generic children of generics not allowed

<5ddc47ad-8f60-47b5-a01a-ae4f928c924an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5131&group=comp.lang.ada#5131

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:1439:: with SMTP id k25mr21700706qkj.439.1619632673636;
Wed, 28 Apr 2021 10:57:53 -0700 (PDT)
X-Received: by 2002:a25:424e:: with SMTP id p75mr27001297yba.161.1619632673483;
Wed, 28 Apr 2021 10:57:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 28 Apr 2021 10:57:53 -0700 (PDT)
In-Reply-To: <6015b52f-992e-48ce-a9b8-11d7a02bfa63n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.102.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.102.170
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<77699289-3e50-4fae-a416-8ce11965f368n@googlegroups.com> <984f3661-59bb-4c09-a686-d456979c54a7n@googlegroups.com>
<e5538816-83ed-4fbb-bcc3-6051a5482c6en@googlegroups.com> <6015b52f-992e-48ce-a9b8-11d7a02bfa63n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5ddc47ad-8f60-47b5-a01a-ae4f928c924an@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Wed, 28 Apr 2021 17:57:53 +0000
Content-Type: text/plain; charset="UTF-8"
 by: AdaMagica - Wed, 28 Apr 2021 17:57 UTC

Vincent Marciante schrieb am Mittwoch, 28. April 2021 um 14:09:23 UTC+2:
> Currently, one would have to make the private child unit generic and then instantiate
> it in the body of the parent at a place were all subunits that require its use can see it,

The body of the parent is invisible to all children. It's the other way round: The body of the parent can with child units.
You have to instantiate a private child unit in the private part of the parent's spec to make it visible to all other children
(this is a simplified description of the facts).

Randy can perhaps say more about your ideas. Post this question to Ada Comment.

Re: [Ada95] Private non-generic children of generics not allowed

<7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5132&group=comp.lang.ada#5132

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:d87:: with SMTP id s7mr30762359qti.32.1619686640182;
Thu, 29 Apr 2021 01:57:20 -0700 (PDT)
X-Received: by 2002:a25:f40f:: with SMTP id q15mr46034180ybd.73.1619686639980;
Thu, 29 Apr 2021 01:57:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.niel.me!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 29 Apr 2021 01:57:19 -0700 (PDT)
In-Reply-To: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.102.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.102.170
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Thu, 29 Apr 2021 08:57:20 +0000
Content-Type: text/plain; charset="UTF-8"
 by: AdaMagica - Thu, 29 Apr 2021 08:57 UTC

Vincent Marciante schrieb am Montag, 26. April 2021 um 17:43:36 UTC+2:
> Why can't
> _private_ children of a generic _always_ for use only in the implementation of the parent unit be allowed?

The reason is quite simple. If the generic parent is instantiated more than once, a nongeneric child (private or public) would be used by all of them. This does not make sense.

Re: [Ada95] Private non-generic children of generics not allowed

<e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5133&group=comp.lang.ada#5133

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:4d43:: with SMTP id x3mr31582957qtv.326.1619691606306;
Thu, 29 Apr 2021 03:20:06 -0700 (PDT)
X-Received: by 2002:a5b:448:: with SMTP id s8mr46083350ybp.363.1619691606181;
Thu, 29 Apr 2021 03:20:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 29 Apr 2021 03:20:06 -0700 (PDT)
In-Reply-To: <7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=35.245.252.196; posting-account=XfA3zgkAAABoz6fRf3Tehtnqqr7Ycml-
NNTP-Posting-Host: 35.245.252.196
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com> <7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: vincent....@l3harris.com (Vincent Marciante)
Injection-Date: Thu, 29 Apr 2021 10:20:06 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Vincent Marciante - Thu, 29 Apr 2021 10:20 UTC

On Thursday, April 29, 2021 at 4:57:21 AM UTC-4, AdaMagica wrote:
> Vincent Marciante schrieb am Montag, 26. April 2021 um 17:43:36 UTC+2:
> > Why can't
> > _private_ children of a generic _always_ for use only in the implementation of the parent unit be allowed?
> The reason is quite simple. If the generic parent is instantiated more than once, a nongeneric child (private or public) would be used by all of them. This does not make sense.

I am asking about a _new_ rule that would make private non-generic child units of generics be like
ones declared in the body of a generic but with their body stubbed and presented in a separate
(_not_ being shared by instances - _not_ being usable/visible in the spec of the generic).

That would allow only the separate bodies of subprograms of the generic that need to use
the private (nongeneric) child of the generic to bring it into context by with'ng it. That would
allow easier restriction of visibility - better information hiding.

(My specific need is in trying to keep down code duplication in a few different implementations
of a generic package: separate body parts/files for each different implementation appear in different
subdirectories and the build system picks the correct ones depending on the variant being built.
Without what we are talking about, I think that I am going to have to declare the would-be private
child in the currently shared generic body, possibly rearrange the code ordering in that body so
that only the - already separate - units that actually need it see it and provide a "null'd out" separate
implementation for the system variants that do not at all need the functionality of the would-be
child unit. That "jumping through hoops" is somewhat distasteful to me and I think _might_ be made
avoidable in the future with a language rule change - _unless_ I am not appreciating some problem
which I expect that a language lawyer would be able to ?easily? point out.)

Re: [Ada95] Private non-generic children of generics not allowed

<56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5134&group=comp.lang.ada#5134

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:a156:: with SMTP id k83mr32240454qke.331.1619694121013;
Thu, 29 Apr 2021 04:02:01 -0700 (PDT)
X-Received: by 2002:a25:9085:: with SMTP id t5mr8842565ybl.504.1619694120851;
Thu, 29 Apr 2021 04:02:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 29 Apr 2021 04:02:00 -0700 (PDT)
In-Reply-To: <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=89.8.67.159; posting-account=uulyKwoAAAA86DO0ODu--rZtbje8Sytn
NNTP-Posting-Host: 89.8.67.159
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com> <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: ehh.pub...@gmail.com (Egil H H)
Injection-Date: Thu, 29 Apr 2021 11:02:01 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 44
 by: Egil H H - Thu, 29 Apr 2021 11:02 UTC

On Thursday, April 29, 2021 at 12:20:07 PM UTC+2, Vincent Marciante wrote:
>
> (My specific need is in trying to keep down code duplication in a few different implementations
> of a generic package: separate body parts/files for each different implementation appear in different
> subdirectories and the build system picks the correct ones depending on the variant being built.

So what you want is a separate package/procedure/function:

generic
package Generic_Foo is
procedure Bar;
end Generic_Foo;

--

package body Generic_Foo is
Name : String := "generic Foo";

package Baz is
procedure Qux;
end Baz;

package body Baz is separate; -magic!

procedure Bar is
begin
Baz.Qux;
end Bar;
end Generic_Foo;

--

with Ada.Text_IO;
separate(Generic_Foo)
package body Baz is
procedure Qux is
begin
Ada.Text_IO.Put_Line("Separate body of " & Name);
end Qux;
end Baz;

(Sorry in advance for google messing up indentation/formatting)

Re: [Ada95] Private non-generic children of generics not allowed

<5990d990-d8fc-489c-bb5d-7f047e14e06an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5135&group=comp.lang.ada#5135

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:205:: with SMTP id b5mr451207qtx.186.1619716668038;
Thu, 29 Apr 2021 10:17:48 -0700 (PDT)
X-Received: by 2002:a5b:448:: with SMTP id s8mr728753ybp.363.1619716667839;
Thu, 29 Apr 2021 10:17:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 29 Apr 2021 10:17:47 -0700 (PDT)
In-Reply-To: <56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=35.245.252.196; posting-account=XfA3zgkAAABoz6fRf3Tehtnqqr7Ycml-
NNTP-Posting-Host: 35.245.252.196
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com> <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>
<56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5990d990-d8fc-489c-bb5d-7f047e14e06an@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: vincent....@l3harris.com (Vincent Marciante)
Injection-Date: Thu, 29 Apr 2021 17:17:48 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Vincent Marciante - Thu, 29 Apr 2021 17:17 UTC

On Thursday, April 29, 2021 at 7:02:02 AM UTC-4, ehh.p...@gmail.com wrote:
> On Thursday, April 29, 2021 at 12:20:07 PM UTC+2, Vincent Marciante wrote:
> >
> > (My specific need is in trying to keep down code duplication in a few different implementations
> > of a generic package: separate body parts/files for each different implementation appear in different
> > subdirectories and the build system picks the correct ones depending on the variant being built.
> So what you want is a separate package/procedure/function:
>
> generic
> package Generic_Foo is
> procedure Bar;
> end Generic_Foo;
>
> --
>
> package body Generic_Foo is
> Name : String := "generic Foo";
>
> package Baz is
> procedure Qux;
> end Baz;
>
> package body Baz is separate; -magic!
>
> procedure Bar is
> begin
> Baz.Qux;
> end Bar;
> end Generic_Foo;
>
> --
>
> with Ada.Text_IO;
> separate(Generic_Foo)
> package body Baz is
> procedure Qux is
> begin
> Ada.Text_IO.Put_Line("Separate body of " & Name);
> end Qux;
> end Baz;
>
>
> (Sorry in advance for google messing up indentation/formatting)

That is pretty much what I have to do except that in my situation
your procedure Bar would also be separate - and that makes the big
difference: If private non-generic units were allowed (and visible
only from the body of the parent generic) then the spec of your Baz
package would not have to be declared in the body of Generic_Foo;
it would be with'd only by the body of Bar (and any other separate
that require it - without any additional declaration order requirements
in the body of Generic_Foo.

The situation would be worse if procedure Quz needed to have a
parameter whose type was not from a package that was already visible
to Genereic_Foo, forcing that package to be with'd in the body of
Generic_Foo. _And_ if the required package would then cause a chain
of dependencies to occur that are not even satisfiable in the variant
environments that do not really require it then that package wouold
also have to be dummied with null or exception-propagating subprograms.

All of that could be avoided in a simple way if use of a private child
unit as I have describe was made legal.

Re: [Ada95] Private non-generic children of generics not allowed

<a1ac3062-0bdb-417a-98e5-8f82c74a5126n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5136&group=comp.lang.ada#5136

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:c202:: with SMTP id i2mr869252qkm.296.1619718232018;
Thu, 29 Apr 2021 10:43:52 -0700 (PDT)
X-Received: by 2002:a25:6d02:: with SMTP id i2mr979125ybc.309.1619718231801;
Thu, 29 Apr 2021 10:43:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 29 Apr 2021 10:43:51 -0700 (PDT)
In-Reply-To: <5990d990-d8fc-489c-bb5d-7f047e14e06an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.102.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.102.170
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com> <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>
<56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com> <5990d990-d8fc-489c-bb5d-7f047e14e06an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a1ac3062-0bdb-417a-98e5-8f82c74a5126n@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Thu, 29 Apr 2021 17:43:52 +0000
Content-Type: text/plain; charset="UTF-8"
 by: AdaMagica - Thu, 29 Apr 2021 17:43 UTC

So what you want is an implicit instantiation as outlined below:

generic
package Gen is
end Gen;
package body Gen is
procedure Proc is separate;
end Gen;

private package Gen.Priv is -- will be implicitly instantiated
end Gen.Priv;

with Gen.Priv;
separate (Gen)
procedure Proc is
begin
...Priv.XXX... -- anything from Priv
end Proc;

This is not very far from the solution given by ehh.

Re: [Ada95] Private non-generic children of generics not allowed

<c0b85e97-e322-4706-a6ad-c5d5d2e3cc70n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5137&group=comp.lang.ada#5137

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:da7:: with SMTP id h7mr1411332qvh.48.1619724551545;
Thu, 29 Apr 2021 12:29:11 -0700 (PDT)
X-Received: by 2002:a25:9c86:: with SMTP id y6mr1596934ybo.405.1619724551404;
Thu, 29 Apr 2021 12:29:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 29 Apr 2021 12:29:11 -0700 (PDT)
In-Reply-To: <a1ac3062-0bdb-417a-98e5-8f82c74a5126n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=35.245.252.196; posting-account=XfA3zgkAAABoz6fRf3Tehtnqqr7Ycml-
NNTP-Posting-Host: 35.245.252.196
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com> <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>
<56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com> <5990d990-d8fc-489c-bb5d-7f047e14e06an@googlegroups.com>
<a1ac3062-0bdb-417a-98e5-8f82c74a5126n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c0b85e97-e322-4706-a6ad-c5d5d2e3cc70n@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: vincent....@l3harris.com (Vincent Marciante)
Injection-Date: Thu, 29 Apr 2021 19:29:11 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Vincent Marciante - Thu, 29 Apr 2021 19:29 UTC

On Thursday, April 29, 2021 at 1:43:52 PM UTC-4, AdaMagica wrote:
> So what you want is an implicit instantiation as outlined below:
>
> generic
> package Gen is
> end Gen;
> package body Gen is
> procedure Proc is separate;
> end Gen;
>
> private package Gen.Priv is -- will be implicitly instantiated
> end Gen.Priv;
>
> with Gen.Priv;
> separate (Gen)
> procedure Proc is
> begin
> ...Priv.XXX... -- anything from Priv
> end Proc;
>
> This is not very far from the solution given by ehh.

I see that you got what I was describing by what you presented in your
example (and yes, not very far from that of ehh) but I'm not sure that
"implicit instantiation" would be the best way to describe it. I'll think about it.

Re: [Ada95] Private non-generic children of generics not allowed

<076b95b5-ff44-4c47-9b0b-50d4546c589bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5139&group=comp.lang.ada#5139

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a0c:9e0f:: with SMTP id p15mr5255485qve.27.1619787403260;
Fri, 30 Apr 2021 05:56:43 -0700 (PDT)
X-Received: by 2002:a25:cf90:: with SMTP id f138mr6723666ybg.92.1619787402997;
Fri, 30 Apr 2021 05:56:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Fri, 30 Apr 2021 05:56:42 -0700 (PDT)
In-Reply-To: <c0b85e97-e322-4706-a6ad-c5d5d2e3cc70n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.102.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.102.170
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com> <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>
<56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com> <5990d990-d8fc-489c-bb5d-7f047e14e06an@googlegroups.com>
<a1ac3062-0bdb-417a-98e5-8f82c74a5126n@googlegroups.com> <c0b85e97-e322-4706-a6ad-c5d5d2e3cc70n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <076b95b5-ff44-4c47-9b0b-50d4546c589bn@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Fri, 30 Apr 2021 12:56:43 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
 by: AdaMagica - Fri, 30 Apr 2021 12:56 UTC

Vincent Marciante schrieb am Donnerstag, 29. April 2021 um 21:29:12 UTC+2:
> but I'm not sure that
> "implicit instantiation" would be the best way to describe it. I'll think about it.

It must be. As Gen.Priv, it has direct visibility to its parent Gen, as a private child also in its parent's private part.
When Gen is instantiated, say as Inst, Gen.Priv cannot have visibility into Inst. So the separate Proc must become

with Inst.Priv;
separate (Inst)
procedure Proc is
begin
....Priv.XXX... -- anything from Priv
end Proc;

Re: [Ada95] Private non-generic children of generics not allowed

<6269dad9$0$22072$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6861&group=comp.lang.ada#6861

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!cleanfeed2-b.proxad.net!nnrp3-2.free.fr!not-for-mail
From: fantome....@free.fr.invalid (Thomas)
Newsgroups: comp.lang.ada
Mail-Copies-To: nobody
Subject: Re: [Ada95] Private non-generic children of generics not allowed
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com> <7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com> <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com> <56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com> <5990d990-d8fc-489c-bb5d-7f047e14e06an@googlegroups.com> <a1ac3062-0bdb-417a-98e5-8f82c74a5126n@googlegroups.com> <c0b85e97-e322-4706-a6ad-c5d5d2e3cc70n@googlegroups.com> <076b95b5-ff44-4c47-9b0b-50d4546c589bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Date: Thu, 28 Apr 2022 02:07:53 +0200
Lines: 25
Message-ID: <6269dad9$0$22072$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 28 Apr 2022 02:07:53 CEST
NNTP-Posting-Host: 91.175.52.121
X-Trace: 1651104473 news-1.free.fr 22072 91.175.52.121:8850
X-Complaints-To: abuse@proxad.net
 by: Thomas - Thu, 28 Apr 2022 00:07 UTC

In article <076b95b5-ff44-4c47-9b0b-50d4546c589bn@googlegroups.com>,
AdaMagica <christ-usch.grein@t-online.de> wrote:

> Vincent Marciante schrieb am Donnerstag, 29. April 2021 um 21:29:12 UTC+2:
> > but I'm not sure that
> > "implicit instantiation" would be the best way to describe it. I'll think
> > about it.
>
> It must be. As Gen.Priv, it has direct visibility to its parent Gen, as a
> private child also in its parent's private part.
> When Gen is instantiated, say as Inst, Gen.Priv cannot have visibility into
> Inst.

isn't it possible to consider that when a child is called from within
the generic parent, it must be called from an instantiation of it,
and then it's not needed to re-do the instantiation within the generic
parent?

it could be a rule that works even when the chils is public, but of
course, the instantiation could be avoided only when it is called from
within the generic parent, not when it is called from outside.

--
RAPID maintainer
http://savannah.nongnu.org/projects/rapid/

Re: [Ada95] Private non-generic children of generics not allowed

<ec5f5c37-9710-4a5a-91b1-6a91b7070a30n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6939&group=comp.lang.ada#6939

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:20ec:b0:461:dc16:163d with SMTP id 12-20020a05621420ec00b00461dc16163dmr5506138qvk.40.1652990353217;
Thu, 19 May 2022 12:59:13 -0700 (PDT)
X-Received: by 2002:a25:450b:0:b0:64d:9f63:bc52 with SMTP id
s11-20020a25450b000000b0064d9f63bc52mr5828095yba.188.1652990353033; Thu, 19
May 2022 12:59:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 19 May 2022 12:59:12 -0700 (PDT)
In-Reply-To: <6269dad9$0$22072$426a74cc@news.free.fr>
Injection-Info: google-groups.googlegroups.com; posting-host=2401:4900:47f1:a1b2:11e8:54e8:f583:2aac;
posting-account=zwvGeAoAAADJ3PQdLuqjS7Otxbhsxpya
NNTP-Posting-Host: 2401:4900:47f1:a1b2:11e8:54e8:f583:2aac
References: <78fd99c3-538d-4981-af11-c1885df36575n@googlegroups.com>
<7e2ece3d-893c-43fb-bf81-6002dbd0bc3dn@googlegroups.com> <e05ca45e-a201-43e7-8397-0b3f7089b2d0n@googlegroups.com>
<56dc220e-1341-4a9f-98cc-132c8afdc2afn@googlegroups.com> <5990d990-d8fc-489c-bb5d-7f047e14e06an@googlegroups.com>
<a1ac3062-0bdb-417a-98e5-8f82c74a5126n@googlegroups.com> <c0b85e97-e322-4706-a6ad-c5d5d2e3cc70n@googlegroups.com>
<076b95b5-ff44-4c47-9b0b-50d4546c589bn@googlegroups.com> <6269dad9$0$22072$426a74cc@news.free.fr>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec5f5c37-9710-4a5a-91b1-6a91b7070a30n@googlegroups.com>
Subject: Re: [Ada95] Private non-generic children of generics not allowed
From: anitaind...@gmail.com (Indra Anita)
Injection-Date: Thu, 19 May 2022 19:59:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2219
 by: Indra Anita - Thu, 19 May 2022 19:59 UTC

https://www.delhimazza.com/
https://www.delhimazza.com/noida-call-girl-and-escort/
https://www.delhimazza.com/gurgaon-call-girl-and-escort/
https://www.delhimazza.com/2022/03/18/delhi-escorts/
https://www.delhimazza.com/2022/03/17/call-girls-in-aerocity/
https://www.delhimazza.com/2022/03/13/noida-call-girls/
https://www.delhimazza.com/2022/03/13/gurgaon-escorts-service/
https://www.delhimazza.com/2022/03/13/noida-escort-service/
https://www.delhimazza.com/2022/03/12/delhi-call-girls/
https://www.delhimazza.com/2021/04/05/call-girl-justdial-phone-number-delhi/

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor