comp.lang.ada
 help / color / mirror / Atom feed
* [Ada95] Private non-generic children of generics not allowed
@ 2021-04-26 15:43 Vincent Marciante
  2021-04-26 16:41 ` AdaMagica
  2021-04-29  8:57 ` AdaMagica
  0 siblings, 2 replies; 15+ messages in thread
From: Vincent Marciante @ 2021-04-26 15:43 UTC (permalink / raw)


[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;

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-05-19 19:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 15:43 [Ada95] Private non-generic children of generics not allowed Vincent Marciante
2021-04-26 16:41 ` AdaMagica
2021-04-26 16:53   ` Vincent Marciante
2021-04-26 17:16     ` AdaMagica
2021-04-28 12:09       ` Vincent Marciante
2021-04-28 17:57         ` AdaMagica
2021-04-29  8:57 ` AdaMagica
2021-04-29 10:20   ` Vincent Marciante
2021-04-29 11:02     ` Egil H H
2021-04-29 17:17       ` Vincent Marciante
2021-04-29 17:43         ` AdaMagica
2021-04-29 19:29           ` Vincent Marciante
2021-04-30 12:56             ` AdaMagica
2022-04-28  0:07               ` Thomas
2022-05-19 19:59                 ` Indra Anita

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