comp.lang.ada
 help / color / mirror / Atom feed
From: tocruisy@my-deja.com
Subject: How can this be !!
Date: Thu, 17 Aug 2000 00:22:08 GMT
Date: 2000-08-17T00:22:08+00:00	[thread overview]
Message-ID: <8nfb6u$5fj$1@nnrp1.deja.com> (raw)

I'm writing a set of programs that execute
finding algorithms .  Part of the
requirements are to overload the comparison
operators to keep track of such
operations.  As each program has similar
requirments moved this part into a
seperate package.  After considerable examination
of my output, my only
conclusion is that my generic procedures won't
insansitate with comparison
functions defined in external packages.  I think
the code will explain it
better.

This is Test.ads

package test is
   type Dummy is new Boolean;  -- Used for
nothing.
end test;

This is my main program declaration for the
generic find :

   generic
      type element is  private;
      type index is (<>);
      type array_element is array(index range <>)
of element;
      with function ">"(left,right:in element)
return boolean;
      with function "<"(left,right:in element)
return boolean;
      procedure Find(the_vector:in
array_element;Min,Max:in out element) ;

It works fine, except for mapping (?) my
comparison functions and here the
problem lays :

ie Here is my instansiation :

   procedure Vector_Find is new
      Find
(integer,integer,vector,test.">",Common."<");

Common is my shared package.  I have commented
out the "<" function in both
the specification and the body.

So, my question is, if neither test, nor common
contain "<" why is it my
code compiles and executes properly, with the
exception of using
standard."<" and standard.">"  I don't
understand.  I thought the unit would
not compile ?  How can I get my instansiation to
use the required comparison
functions "<",">" defined in common.ads. ?

Any help would be much appreciated.


Jason
tocruisy@hotmail.com


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



                 reply	other threads:[~2000-08-17  0:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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