# Child package vs nested package

**URL:** <https://forum.ada-lang.io/t/child-package-vs-nested-package/4919>\
**Category:** General\
**Created:** [November 6, 2026, 5:49pm UTC](https://forum.ada-lang.io/t/child-package-vs-nested-package/4919 "2026-11-06T17:49:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjorn-lundin](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/bjorn-lundin/32/106_2.png) [@bjorn-lundin](https://forum.ada-lang.io/u/bjorn-lundin)\
**Post date:** [November 6, 2026, 5:49pm UTC](https://forum.ada-lang.io/t/child-package-vs-nested-package/4919/1 "2026-11-06T17:49:02Z")

</div>

what is the difference between

```ada
package P is
  procedure A;
end P;

package body P is
  procedure A is null;
end P;

package P.Q is
  procedure A2;
end P.Q;

package body P.Q is
  procedure A2 is null;
end P.Q;

```

and

```ada
package P is
  procedure A;
  
  package Q is
    procedure A2;
  end Q;
end P;

package body P is
  procedure A is null;

  package body Q is
    procedure A2 is null;
  end Q;

end P;

```

is it visibility ?

---

<div class="post-metadata">

**Author:** ![Nordic\_Dogsledding](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/nordic_dogsledding/32/547_2.png) [@Nordic\_Dogsledding](https://forum.ada-lang.io/u/Nordic_Dogsledding)\
**Post date:** [November 6, 2026, 6:12pm UTC](https://forum.ada-lang.io/t/child-package-vs-nested-package/4919/2 "2026-11-06T18:12:32Z")

</div>

It’s visibility as you guessed. Nested units have visibility to the parent body (if they have a body), child units don’t.
