comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst@cts.com>
Subject: Re: Ada 0y wish list: "with private"
Date: 12 Feb 2001 16:10:44 -0800
Date: 2001-02-12T16:10:44-08:00	[thread overview]
Message-ID: <yecae7rigsb.fsf@king.cts.com> (raw)
In-Reply-To: 968p1e$8m7$1@s1.read.news.oleane.net

"Thierry Lelegard" <thierry.lelegard@canal-plus.fr> writes:
> Recently, several wishlist items for Ada 0y were posted in c.l.a.
> Like many old Ada users, I have a couple of them. I would like to
> propose one for discussion: a "with private" extension.
> 
> The idea is to specify in a context clause of a unit spec that an
> external unit can be used only in the private part.
> 
> Example:
> 
> with A;
> with private B;
> package C is
>    X : A.TA;
> private
>    Y : B.TB; -- legal only in private part
> end C;

What about this syntax:

with A;
package C is
   X : A.TA;
private
   with B;
   Y : B.TB;
end C;

The advantage is that it puts the context clause within the private
part, which is what it applies to.

One possible drawback: Currently, the compiler sees all the context
clauses before the beginning of the package; with this syntax, it will
have to process the public declarations of C before seeing the "with
B;".  Some implementations would have more difficulty with this than
others; would it be an unreasonable burden for any of them?

(It also looks a bit odd to put a context clause into a sequence of
declarations.)

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
MAKE MONEY FAST!!  DON'T FEED IT!!



  reply	other threads:[~2001-02-13  0:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-12 13:41 Ada 0y wish list: "with private" Thierry Lelegard
2001-02-13  0:10 ` Keith Thompson [this message]
2001-02-13  0:13 ` Jeff Creem
2001-02-13  6:37   ` Dale Stanbrough
2001-02-13 12:01     ` Jeff Creem
2001-02-13  8:48 ` Dr Adrian Wrigley
2001-02-13  8:56 ` Michel Gauthier
2001-02-13 16:31 ` Ehud Lamm
  -- strict thread matches above, loose matches on Subject: below --
2001-02-15  1:04 Beard, Frank
2001-02-15  4:18 ` Jeffrey Carter
2001-02-15  4:53 Christoph Grein
2001-02-15 19:16 Beard, Frank
replies disabled

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