comp.lang.ada
 help / color / mirror / Atom feed
* When is a rename not a rename?
@ 2013-01-29  1:24 Adam Beneschan
  2013-01-30  0:28 ` Randy Brukardt
  2013-02-01 10:44 ` Ada novice
  0 siblings, 2 replies; 19+ messages in thread
From: Adam Beneschan @ 2013-01-29  1:24 UTC (permalink / raw)


I've always assumed that if you declare a name to be a rename of some other entity (*), there wouldn't be any impact on the program, other than that you can use the new name to mean the same thing as the thing that it renames.

In particular, for library unit packages, if P2 is a library unit package that renames P1, then a unit that says "with P2;" should work the same as one that says "with P1;" after you've done whatever is necessary to make sure all names in the unit refer to the same entities.  Right?

I've just discovered that this isn't the case...

with P1;
with P3;
package P2 renames P1;

Now, a program that says "with P2;" may operate differently from one that with's P1--because saying "with P2" will cause P3's elaboration code to be executed at the beginning of the program, while saying "with P1" will not [unless P3 is included in the program via some other path].

I wonder if this was the intent, or if it's a "bug" in the language definition?

                           -- Adam


(*) Not counting a renaming-as-body, which is different because the first declaration of the name is *not* a renaming declaration.



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-02-05  9:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-29  1:24 When is a rename not a rename? Adam Beneschan
2013-01-30  0:28 ` Randy Brukardt
2013-01-30  0:52   ` Adam Beneschan
2013-01-30  9:31     ` Dmitry A. Kazakov
2013-01-30 14:35       ` ytomino
2013-02-01 10:44 ` Ada novice
2013-02-01 11:27   ` Dmitry A. Kazakov
2013-02-01 17:32     ` Adam Beneschan
2013-02-01 18:31       ` ytomino
2013-02-02  1:40         ` Adam Beneschan
2013-02-02 12:24           ` ytomino
2013-02-02 14:26           ` Robert A Duff
2013-02-02 17:11             ` Shark8
2013-02-02  0:42       ` Brian Drummond
2013-02-02 11:43         ` AdaMagica
2013-02-03 11:50           ` Brian Drummond
2013-02-03 12:16             ` AdaMagica
2013-02-05  9:53       ` Ada novice
2013-02-01 17:48     ` Ada novice

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