comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: "private with" proposal
Date: Tue, 3 Dec 2002 13:24:02 -0600
Date: 2002-12-03T13:24:02-06:00	[thread overview]
Message-ID: <uuq160jpbkkn0c@corp.supernews.com> (raw)
In-Reply-To: 3DEC42E0.407B@earthlink.net

Vincent Marciante wrote in message <3DEC42E0.407B@earthlink.net>...
>Stephen Leake wrote:
>
>> You are correct, the "extra syntax" of "private" in the context
clause
>> is not strictly necessary; the compiler and reader could figure out
>> what's going on.
>>
>> But what is the downside of having the extra syntax?
>
>Discussing in the same AI as the one pertaining to
>visability _within_ hierarchies confuses to issue.


The entire point is that visibility is the wrong model for this. The
syntax is tied to a legality rule (not a visibility rule), in order that
added or removing 'private' or moving a declaration from the private
part to the visible part does not silently change the meaning of a
program. (This is covered in the AI).

A secondary issue is the desire to think of the private part as a
separate part. We discussed allowing separate compilation of private
parts; in that case, 'private with' is just the context clause of the
private part.

The visibility rules are already way too complex in Ada, and your
suggestion would make them even more complex. Moreover, changing a unit
from private to non-private (or vice-versa) could silently change the
meaning of a program from one legal meaning to a different legal
meaning. (Currently, any such program is illegal, as the with would be
illegal when the unit is private; with 'private with' as currently
described, the use that causes the problem would be illegal.)

In any case, 'private with' is easy to describe, easy to understand,
easy to use, and easy to implement. A better solution (such as separate
compilation of private parts) may exist, but waiting for the perfect
solution to an important problem when we have an adequate solution that
we can use now would be a mistake.

                    Randy Brukardt






  reply	other threads:[~2002-12-03 19:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-09  6:39 Style: always declare subrountines? Victor Porton
2002-11-09 11:09 ` sk
2002-11-09 12:34 ` Victor Porton
2002-11-09 14:34   ` Jim Rogers
2002-11-09 14:53   ` sk
2002-11-09 15:36 ` Robert A Duff
2002-11-09 16:16 ` Frank J. Lhota
2002-11-09 16:28 ` chris.danx
2002-11-09 18:36 ` Simon Wright
2002-11-12 17:31 ` Stephen Leake
2002-11-18  1:52 ` ;Re: " Richard Riehle
2002-11-28 10:32   ` John English
2002-11-28 12:52     ` Lutz Donnerhacke
2002-12-03 11:15       ` John English
2002-12-03 12:22         ` Lutz Donnerhacke
2002-12-03 13:11           ` John English
2002-12-03 14:31             ` Robert A Duff
2002-12-03 14:41               ` Lutz Donnerhacke
2002-11-28 17:49     ` Vincent Marciante
2002-12-03 11:09       ` John English
2002-11-28 18:45     ` "private with" proposal Vincent Marciante
2002-11-28 20:12       ` David C. Hoos, Sr.
2002-11-29  4:28         ` Vincent Marciante
2002-12-01  1:00           ` Dale Stanbrough
2002-12-02 18:20       ` Stephen Leake
2002-12-03  5:37         ` Vincent Marciante
2002-12-03 19:24           ` Randy Brukardt [this message]
2002-12-04  3:52             ` Vincent Marciante
replies disabled

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