comp.lang.ada
 help / color / mirror / Atom feed
* How can this be !!
@ 2000-08-17  0:22 tocruisy
  0 siblings, 0 replies; only message in thread
From: tocruisy @ 2000-08-17  0:22 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-08-17  0:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-17  0:22 How can this be !! tocruisy

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