From: bobduff@world.std.com (Robert A Duff)
Subject: Re: types in procedure arguments
Date: 1996/10/01
Date: 1996-10-01T00:00:00+00:00 [thread overview]
Message-ID: <DyLMpt.8wu@world.std.com> (raw)
In-Reply-To: 52piii$8n7@noc2.drexel.edu
In article <52piii$8n7@noc2.drexel.edu>,
Chris Papademetrious <st92j0gw@dunx1.ocs.drexel.edu> wrote:
> I have gotten some replies via email, and am beginning to believe
>that this is a more interesting problem than I first thought! Here's
>a very simplified version of the situation. Essentially, in the real
>problem, I'm using a presupplied doubly-linked-list package and vector
>math package (gotta put that reuse principle to work, right?).
Now that I see the source code, I see what you're talking about.
You need to have just one instantiation of Tst_Double_List, not two.
You could make that a library unit, and import it into both
Tst_Best_Congruence and Tst. However, I assume Tst_Best_Congruence
is the re-used thing, and you don't want to modify it. In that case,
you could do something like this:
with Tst_Best_Congruence;
with Tst_Vectors;
procedure Tst is
package Vec_List renames Tst_Best_Congruence.Vec_List;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
L: Vec_List.LIST_ID;
begin
Tst_Best_Congruence.Best_Congruence(L);
end Tst;
Or, don't use the renaming, and just say:
L: Tst_Best_Conguence.Vec_List.LIST_ID;
Or, use use_clauses:
with Tst_Best_Congruence;
use Tst_Best_Congruence;
use Tst_Best_Congruence.Vec_List;
with Tst_Vectors;
procedure Tst is
L: LIST_ID;
begin
Best_Congruence(L);
end Tst;
(I didn't compile these -- sorry for any silly mistakes.)
> procedure Best_Congruence
> (
> List: in Point_List.LIST_ID
> ) is
> begin
> List := List;
That's illegal -- you can modify an 'in' parameter.
- Bob
next prev parent reply other threads:[~1996-10-01 0:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-09-23 0:00 types in procedure arguments Chris Papademetrious
1996-09-25 0:00 ` Stephen Leake
1996-09-28 0:00 ` Chris Papademetrious
1996-09-28 0:00 ` Chris Papademetrious
1996-09-30 0:00 ` Chris Papademetrious
1996-10-01 0:00 ` Robert A Duff [this message]
1996-10-01 0:00 ` Norman H. Cohen
1996-10-01 0:00 ` Robert Dewar
1996-10-01 0:00 ` Stephen Leake
-- strict thread matches above, loose matches on Subject: below --
1996-09-28 0:00 Robert Dewar
1996-09-30 0:00 ` Chris Papademetrious
1996-09-30 0:00 ` Stephen Leake
1996-09-30 0:00 ` Norman H. Cohen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox