Ada generics / GNAT Heap-sort 
Author Message
 Ada generics / GNAT Heap-sort

I'm trying to instatiate the heap-sort (generic version) that came
with GNAT (3.04A WIN32).  I have created my own(main) procedure that
will sort of act like a driver, created an array type (of ints) and
with'ed gnat.heap_sort_g.  Furhter, after careful examination of
gnat.heap_sort_g.adb and and .ads specification file it appears that I
need to supply the functions Lt (less than) and move (swap).  I am
having trouble figureing out exactly how to do this and have looked up
generics in two different textbooks only to seemingly get shafted on
this.  I am still confused.  The package specification for
gnat.heap_sort_g says something like...
generic
        type whatever is whatever else;
        etc
        procedure move(from,to:natural) ;
        procedure lt(ob1,ob2:natural) return boolean;
package gnat.heap_sort_g is
end gnat.heap_sort_g;

(leaving out alot of other stuff), so I am thinking that I must create
these functions LT, and Move exactly according to the specifications
(since its not the the .adb file).  So i created my own lt and move in
my procedure but gnatmake still responds with an error.  Am I doing
something obviously wrong like going at this the wrong way or what?
Can someone please give me a pointer to the right way to instatite
this package?
Thanks
james



Thu, 22 Apr 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Heap sort status 1973

2. heap sort in 68k ?

3. gnat and heap size

4. Debugging Generics with GNAT 3.07

5. GNAT Problem on recursive generics?

6. generics defined in terms of generics?

7. generics using generics (long)

8. DOS GNAT or Win95/NT GNAT? (Ada 95)

9. Inheritance and Ada (and access types and generics)

10. Generics - Difference between ADA and Modula--3

11. Ada '0x generics brain-fartz (long)

12. Ada Generics vs. C++ templates

 

 
Powered by phpBB® Forum Software