comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Child packages named Ada illegal?
Date: Wed, 31 Oct 2012 10:20:31 -0700 (PDT)
Date: 2012-10-31T10:20:31-07:00	[thread overview]
Message-ID: <4ef3d6d1-94e8-4b9e-8f80-c55da3bff811@googlegroups.com> (raw)
In-Reply-To: <c3f831f0-a622-4f20-9d9d-db035651758b@googlegroups.com>

On Wednesday, October 31, 2012 9:47:04 AM UTC-7, Marius Amado-Alves wrote:
> I was getting misleading <<missing "with Ada...">> errors from GNAT (the packages were withen). In a moment of inspiration I renamed package AA.Languages.Ada to AA.Languages.Ada_Languages and all went well.
> 
> Just curious: was GNAT misbehaving (unlikely) or is it somehow forbidden to have child packages named Ada?
> 

Without seeing your exact code, it's hard to say for sure, but Shark8 is probably right that it's a visibility issue.  If you're inside AA.Languages.Ada, and you refer to the identifier Ada without any other qualification, then that identifier would refer to your child package, not the top level Ada package.  (Standard.Ada would still get you the top-level package.)  The error messages are confusing, though.  I can understand it, because 99.9999% of the time when a user uses one of the language-defined package names and it isn't defined, it's because they forgot to WITH it; the GNAT people apparently didn't think of this possibility, which is understandable.

                           -- Adam



  parent reply	other threads:[~2012-10-31 17:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 16:47 Child packages named Ada illegal? Marius Amado-Alves
2012-10-31 17:02 ` Shark8
2012-10-31 17:20 ` Adam Beneschan [this message]
2012-10-31 17:59   ` Marius Amado-Alves
2012-10-31 18:16     ` Adam Beneschan
2012-10-31 18:41       ` Marius Amado-Alves
2012-10-31 19:39         ` Shark8
2012-11-01  9:27         ` AdaMagica
replies disabled

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