comp.lang.ada
 help / color / mirror / Atom feed
* beginner ada generic fonction
@ 2002-03-23  1:37 annabelle
  2002-03-23  3:29 ` Steve Doiel
  0 siblings, 1 reply; 8+ messages in thread
From: annabelle @ 2002-03-23  1:37 UTC (permalink / raw)


Hello,

I was given a spec(ADS)using genericity. I have to use the function
"TheKey" (see below)

______________________________________________________________________
GENERIC
  TYPE Element_type IS Private
  Key_type IS Private;                              

  WITH Function TheKey (my_item : Element_type) Return Key_type; 

  WITH Function "<"  (Left,Right: Key_type) Return Boolean; 
______________________________________________________________________

I am trying to use the function "TheKey" in my ADA program but I need
to use the function for TWO different type of elements !!!
______________________________________________________________________

	function TheKey(My_item: a_course) return Course_key_type is
		
	begin
		Return My_item.course_key;
	end lacle;
______________________________________________________________________

How can I use the same function for another type (a_student)??

Please HELP !!!



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-03-25  6:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-23  1:37 beginner ada generic fonction annabelle
2002-03-23  3:29 ` Steve Doiel
2002-03-24  2:55   ` annabelle
2002-03-24  3:10   ` annabelle
2002-03-24  3:51     ` Steve Doiel
2002-03-24 17:31       ` annabelle
2002-03-25  6:05         ` Simon Wright
2002-03-24 20:37       ` annabelle

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