comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Re: Stupid question
Date: 12 Apr 2007 15:02:18 -0700
Date: 2007-04-12T15:02:18-07:00	[thread overview]
Message-ID: <1176415338.362267.115580@l77g2000hsb.googlegroups.com> (raw)
In-Reply-To: <1176414032.163717.31900@y80g2000hsf.googlegroups.com>

I wrote:

> On Apr 12, 1:05 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>
> > generic
> > package A is
> >    A1 : Integer;
> > end A;
>
> > generic
> > package A.B is
> > end A.B;
>
> > with A.B;
> > generic
> >    with package A_B is new A.B (<>);
> > package C is
> >    -- What is the name of A1 from A of A_B?
> > end C;
>
> I am betting that if you try to compile just the code snippet you've
> got, you will figure out your answer.

Sorry about that answer.  I made the rash assumption that you would be
using a compiler that works.  But apparently that's not necessarily
the case.

The version of GNAT I've got installed compiles the above code with no
errors, despite the fact that it's illegal.  I was assuming that you'd
get an error and the error would help you figure out what was wrong;
but I didn't figure on this happening.

The problem is that you cannot refer to A.B the way you did in your
"with package" declaration; you can only refer to A_Inst.B where
A_Inst is an instance of A (A_Inst could be another generic formal
package).

                                  -- Adam





  reply	other threads:[~2007-04-12 22:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 20:05 Stupid question Dmitry A. Kazakov
2007-04-12 21:40 ` Adam Beneschan
2007-04-12 22:02   ` Adam Beneschan [this message]
2007-04-13  8:20     ` Dmitry A. Kazakov
2007-04-13 13:53       ` Anh Vo
2007-04-13 15:35       ` Adam Beneschan
2007-04-13 17:12         ` Dmitry A. Kazakov
2007-04-13 18:14           ` Adam Beneschan
2007-04-13 18:50             ` Adam Beneschan
2007-04-13 19:01           ` Randy Brukardt
2007-04-13 19:33             ` Markus E Leypold
2007-04-13 23:39               ` Randy Brukardt
2007-04-14  7:25                 ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2003-10-08  3:12 stupid question Shanon Fernald
2003-10-08  3:31 ` James Rogers
2003-10-08  4:34 ` Steve
2003-10-08 12:54   ` Marin David Condic
2003-10-08 13:01 ` Marin David Condic
2003-10-08 22:18 ` Robert I. Eachus
2003-10-09 10:09   ` Steffen Huber
2003-10-10 16:02     ` Robert I. Eachus
replies disabled

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