comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Elaborate_All on child package
Date: Tue, 6 Sep 2011 22:03:35 -0700 (PDT)
Date: 2011-09-06T22:03:35-07:00	[thread overview]
Message-ID: <f6625cce-8165-4f93-9ea3-ddf13f588045@b20g2000vbz.googlegroups.com> (raw)
In-Reply-To: wcc39g992bp.fsf@shell01.TheWorld.com

> 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.

I guess he wanted them to stand out and not be hidden somewhere
inside.

> 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.

Perhaps. I guess this special syntax was used because of the different
kind of parameters. In Ada 83, there were no subprogram parameters, so
since for generics, there are these kind of formals, Ichbiah chose
special syntax. Today, with subprogram parameters existing (but still
no type parameters), syntax decisions could have been different.

(I gather, with all the syntax and semantics discussions in this
group, we would have at least 100 different Adas if we were to start
from scratch.)



  reply	other threads:[~2011-09-07  5:03 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
2011-09-07  5:03         ` AdaMagica [this message]
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