comp.lang.ada
 help / color / mirror / Atom feed
* child packages and nested packages
@ 2002-03-23 15:02 Oliver Kellogg
  2002-03-25 15:01 ` Ted Dennison
  2002-03-28  9:51 ` Oliver Kellogg
  0 siblings, 2 replies; 18+ messages in thread
From: Oliver Kellogg @ 2002-03-23 15:02 UTC (permalink / raw)


Hello CLA,

How come child packages are only possible for library level packages?

I now encountered a situation where I'd like to create a child 
package of a nested package:

-- file: pkg.ads
package Pkg is
   package Nested is
      type Object is tagged null record;
   end Nested;
end Pkg;

-- file: pkg-nested-child.ads
package Pkg.Nested.Child is
   type Derived is new Object with null record;
end Pkg.Nested.Child;


(The only thing that crosses my naive mind is that this makes 
life harder for the Ada compiler in that if a file pkg-nested.ads 
cannot be found then the compiler would need to look inside pkg.ads 
to see if the parent to which the child refers can be found there.)

Thanks,

O. Kellogg



^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: child packages and nested packages
@ 2010-03-04  5:37 Oliver Kellogg
  2010-03-04 14:55 ` Admin - Do Not Email
  2010-03-04 16:12 ` Adam Beneschan
  0 siblings, 2 replies; 18+ messages in thread
From: Oliver Kellogg @ 2010-03-04  5:37 UTC (permalink / raw)


Referring back to
http://groups.google.com/group/comp.lang.ada/msg/c14a79f7d21f5ebf ,

On Mar 29 2002, 2:05 pm, Oliver Kellogg wrote:

> Sergey Koshcheyev <serk...@hotmail.com> wrote:
> > Just a quick idea - maybe using "is separate" in some right places
> > would solve it? Like having the spec of A.B.Impl inside A.B, and
> > having the body separate.
> 
> That's definitely possible, but still only a workaround solution.

I have to correct myself. It's not so definitely possible:

-- file: a.ads
package A is  -- module A
   package B is     -- interface B
      package Impl is
         procedure X;
      end Impl;
   end B;
end A;

-- file: a.adb
package body A is
   package body B is
      -- Implementation for interface B,
      -- body to be provided by user
      package body Impl is separate;
   end B;
end A;


$ gcc -c a.adb
a.adb:6:07: stub cannot appear in an inner scope



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

end of thread, other threads:[~2010-03-04 16:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-23 15:02 child packages and nested packages Oliver Kellogg
2002-03-25 15:01 ` Ted Dennison
2002-03-25 19:26   ` Oliver Kellogg
2002-03-25 22:31     ` Stephen Leake
2002-04-23 21:44     ` Oliver Kellogg
2002-04-24 14:52       ` Oliver Kellogg
2002-03-26 14:21   ` Marin David Condic
2002-03-28  9:51 ` Oliver Kellogg
2002-03-28 14:49   ` Ted Dennison
2002-03-28 18:30     ` Oliver Kellogg
2002-03-28 22:13       ` Ted Dennison
2002-03-29  5:30         ` Oliver Kellogg
2002-03-29 11:59           ` Sergey Koshcheyev
2002-03-29 15:14             ` Ted Dennison
2002-03-29 13:05           ` Oliver Kellogg
  -- strict thread matches above, loose matches on Subject: below --
2010-03-04  5:37 Oliver Kellogg
2010-03-04 14:55 ` Admin - Do Not Email
2010-03-04 16:12 ` Adam Beneschan

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