comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Elaborate_All on child package
Date: Tue, 06 Sep 2011 10:23:54 -0400
Date: 2011-09-06T10:23:54-04:00	[thread overview]
Message-ID: <wcc39g992bp.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 9cmmh0Fm55U1@mid.individual.net

Niklas Holsti <niklas.holsti@tidorum.invalid> writes:

> Robert A Duff wrote:
>
>> Right.  The visibility rules in context clauses are special.
>> They have to be, because the context clause are determining what's
>> visible elsewhere.  Why Jean Ichbiah chose this exact design,
>> I don't know.  I would have put the 'with' clauses inside the
>> package.
>
> If the 'with' clauses would be inside the package, you would have to
> change also the location of the generic formals for generic packages,
> wouldn't you? The declarations of the formals should be able to refer to
> entities in 'withed' packages.

You wouldn't have to, but you'd want to.

Note that Ada has always allowed forward references:

generic
   type Formal_Type is (<>);
   with procedure P (X : My_Generic.Formal_Type);  <-- This is legal!
package My_Generic is
end My_Generic;

which is a bit strange, given that Ada doesn't allow forward references
in general.

Anyway, generic formal parameters are analogous to a procedure's formal
parameters -- in both cases, they ought to come after the name of the
thing being declared.

- Bob



  reply	other threads:[~2011-09-06 14:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-03 16:57 Elaborate_All on child package Rego, P.
2011-09-05  5:21 ` AdaMagica
2011-09-05  9:28   ` Georg Bauhaus
2011-09-10 19:24   ` Rego, P.
2011-09-06  7:05 ` Egil Høvik
2011-09-06 12:51   ` Robert A Duff
2011-09-06 13:46     ` Niklas Holsti
2011-09-06 14:23       ` Robert A Duff [this message]
2011-09-07  5:03         ` AdaMagica
2011-09-07 10:49           ` Georg Bauhaus
replies disabled

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