comp.lang.ada
 help / color / mirror / Atom feed
From: st92j0gw@dunx1.ocs.drexel.edu (Chris Papademetrious)
Subject: Re: types in procedure arguments
Date: 1996/09/28
Date: 1996-09-28T00:00:00+00:00	[thread overview]
Message-ID: <52jqh0$pq@noc2.drexel.edu> (raw)
In-Reply-To: 5268qg$r1t@noc2.drexel.edu


 I've got a small problem that most likely extends from my lack of
knowledge about Ada 95, so I'm turning to the gurus for help.

 I have a procedure that I'd like to pass a list of "Points" (just a
two-dimensional coordinate) as an input.  Now, I have a doubly linked
list type defined in a package.  This package requires a generic
argument of what it is a linked list *of*, so, I need to instantiate
the list package with the parameter of type Point before I can define
the input argument as a List argument.

 No problem, I'll just put the procedure in a package wrapper, and
define the linked list type before the procedure, to make everything
happy!  Well, that works, except when I try to USE the procedure in
another package.  When I passed a list parameter where I call the
procedure, I get the following error:

 lazarus(10:55)/home/chrispy/bot > gnatmake best_test
gcc -c best_test.adb
best_test.adb:45:35: expected private type "LIST_ID" defined at
double_list.ads: 43
best_test.adb:45:35: found private type "LIST_ID" defined at
double_list.ads:43
gnatmake: "best_test.adb" compilation error

 The source location for the type it expected and the type it got are
the same, BUT they're incompatible types!  To me, this means that this
problem arises from the fact that I had to redefine the list type to
be able to specify it as a function argument in the procedure package
itself, because that is essentially a NEW, incompatible type.

 How the heck do I get around something like this??

 - Chris


-=-=-=-=-=-=-=-=-=-=-=-=-
 Chris Papademetrious
 Data Fusion Laboratory
 Drexel University
 Philadelphia, PA
-=-=-=-=-=-=-=-=-=-=-=-=-





  parent reply	other threads:[~1996-09-28  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 [this message]
1996-09-28  0:00 ` Chris Papademetrious
1996-09-30  0:00 ` Chris Papademetrious
1996-10-01  0:00   ` Stephen Leake
1996-10-01  0:00   ` Robert Dewar
1996-10-01  0:00   ` Norman H. Cohen
1996-10-01  0:00   ` Robert A Duff
  -- 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