comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve Doiel" <nospam_steved94@attbi.com>
Subject: Re: beginner ada generic fonction
Date: Sat, 23 Mar 2002 03:29:03 GMT
Date: 2002-03-23T03:29:03+00:00	[thread overview]
Message-ID: <3ESm8.101615$q2.10433@sccrnsc01> (raw)
In-Reply-To: 8235efb6.0203221737.44abefff@posting.google.com

Since you obviously don't have a textbook, I'd like to point you to the
relevent chapter of one you can find on-line:

http://www.it.bton.ac.uk/staff/je/adacraft/ch12.htm

I hope this helps,
SteveD


"annabelle" <ametayer98@hotmail.com> wrote in message
news:8235efb6.0203221737.44abefff@posting.google.com...
> 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 !!!





  reply	other threads:[~2002-03-23  3:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-23  1:37 beginner ada generic fonction annabelle
2002-03-23  3:29 ` Steve Doiel [this message]
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
replies disabled

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