comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: generic package dilemma
Date: 1999/11/22
Date: 1999-11-22T00:00:00+00:00	[thread overview]
Message-ID: <81bqg4$55t$1@nnrp1.deja.com> (raw)
In-Reply-To: 3835CF6B.C78469E@mitre.org

In article <3835CF6B.C78469E@mitre.org>,
  "Robert I. Eachus" <eachus@mitre.org> wrote:
> Robert Dewar wrote:

>  There are very special cases where you should use Elaborate
   instead of Elaborate_All, and I occasionally run into them
   when creating mutually recursive types.

Whenever you use Elaborate instead of Elaborate_All, you are
counting on (illicit) knowledge of what is in the package body.
The above statement is equivalent to a special case of:

"there are very special cases where the client must know details
of the coding in the package body, ...."

Perhaps, but this is always undesirable, so if you can find
another way of solving the problem you should. In all our
experience with (millions and millions of lines) of Ada code,
the only legitimate case for using Elaborate that has cropped
up is when compiling old legacy Ada 83 code.

Note that in default mode, GNAT supplies the recommended
Elaborate_All pragmas implicitly, and it is very rare that
new Ada 95 code runs into trouble with this rule (the most
common case is where tasks are started at elaboration time).
In no cases has the solution been to use pragma Elaborate.

The reason that Robert Dewar strongly argued to keep Elaborate
in the language as a first class citizen was

a) one can construct cases in which it is the only way of doing
things, so from a formal point of view, eliminating it would
subset the language.

b) more pragmatically, people HAVE constructed such cases pretty
frequently, usually by accident, in Ada 83 legacy code :-)


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~1999-11-22  0:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-17  0:00 generic package dilemma Riyaz Mansoor
1999-11-17  0:00 ` Matthew Heaney
1999-11-17  0:00   ` Mats Weber
1999-11-17  0:00     ` Matthew Heaney
1999-11-18  0:00       ` Mats Weber
1999-11-18  0:00         ` Matthew Heaney
1999-11-19  0:00           ` Mats Weber
1999-11-19  0:00             ` Vladimir Olensky
1999-11-19  0:00             ` Matthew Heaney
1999-11-19  0:00               ` Mats Weber
1999-11-22  0:00                 ` Robert Dewar
1999-11-22  0:00                   ` Mats Weber
1999-11-22  0:00                     ` Bryce Bardin
1999-11-23  0:00                     ` Robert Dewar
1999-11-22  0:00                   ` Larry Kilgallen
1999-11-23  0:00                     ` Robert Dewar
1999-11-22  0:00                   ` Mats Weber
1999-11-22  0:00                     ` Robert A Duff
1999-11-23  0:00                       ` Robert Dewar
1999-12-01  0:00                       ` Robert I. Eachus
1999-12-01  0:00                         ` Robert I. Eachus
1999-11-22  0:00                   ` Robert A Duff
1999-11-23  0:00                     ` Robert Dewar
1999-11-29  0:00                       ` Robert A Duff
1999-12-01  0:00                         ` Robert Dewar
1999-12-01  0:00                       ` Robert A Duff
1999-12-02  0:00                         ` Mats Weber
1999-12-03  0:00                           ` Robert Dewar
1999-12-03  0:00                             ` Ted Dennison
1999-12-04  0:00                               ` Robert Dewar
1999-12-03  0:00                             ` Robert A Duff
1999-12-06  0:00                               ` Robert Dewar
1999-11-19  0:00               ` Robert Dewar
1999-11-19  0:00                 ` Matthew Heaney
1999-11-20  0:00                   ` Mats Weber
1999-11-19  0:00                 ` Robert I. Eachus
1999-11-22  0:00                   ` Robert Dewar [this message]
1999-11-22  0:00                     ` Matthew Heaney
1999-11-18  0:00       ` Robert A Duff
1999-11-18  0:00         ` Matthew Heaney
1999-11-19  0:00       ` Robert Dewar
1999-11-18  0:00   ` Riyaz Mansoor
1999-11-19  0:00     ` Robert Dewar
1999-11-19  0:00   ` Robert Dewar
replies disabled

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