comp.lang.ada
 help / color / mirror / Atom feed
* function to generic
@ 2001-11-12 18:48 kotee
  2001-11-12 19:02 ` Preben Randhol
  2001-11-12 20:11 ` Matthew Heaney
  0 siblings, 2 replies; 4+ messages in thread
From: kotee @ 2001-11-12 18:48 UTC (permalink / raw)


hi all

i write my own data type, but i need an "=" operator for it.
i know that generic packages can get functions as
parameter. how it works exactly? i try to find out
from ref guides, but i don't find it. :((
thanks

kotee



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

* Re: function to generic
  2001-11-12 18:48 function to generic kotee
@ 2001-11-12 19:02 ` Preben Randhol
  2001-11-13 16:07   ` kotee
  2001-11-12 20:11 ` Matthew Heaney
  1 sibling, 1 reply; 4+ messages in thread
From: Preben Randhol @ 2001-11-12 19:02 UTC (permalink / raw)


On 12 Nov 2001 19:48:45 +0100, kotee@ludens.elte.hu wrote:
> hi all
> 
> i write my own data type, but i need an "=" operator for it.
> i know that generic packages can get functions as
> parameter. how it works exactly? i try to find out
> from ref guides, but i don't find it. :((

Don't read ref. books, read a text on Ada book. Here are some online.

http://www.it.bton.ac.uk/staff/je/adacraft/
http://burks.bton.ac.uk/burks/language/ada/ada95.pdf

http://www.adapower.com/learn/adadistilled.html

Preben



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

* Re: function to generic
  2001-11-12 18:48 function to generic kotee
  2001-11-12 19:02 ` Preben Randhol
@ 2001-11-12 20:11 ` Matthew Heaney
  1 sibling, 0 replies; 4+ messages in thread
From: Matthew Heaney @ 2001-11-12 20:11 UTC (permalink / raw)



<kotee@ludens.elte.hu> wrote in message news:0KJ+h2G3o9zP@ludens...
> hi all
>
> i write my own data type, but i need an "=" operator for it.

Do you mean assignment, or a test for equality?  I assume you mean test for
equality:

package P is

   type T is limited private;
   function "=" (L, R : T) return Boolean;
...
end P;

> i know that generic packages can get functions as
> parameter. how it works exactly? i try to find out
> from ref guides, but i don't find it. :((

Is your package generic?  Do you want to declare a generic formal
subprogram?

generic
   type Element_Type is private;
   with function "=" (L, R : Element_Type) return Boolean is <>;
package GP is ...







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

* Re: function to generic
  2001-11-12 19:02 ` Preben Randhol
@ 2001-11-13 16:07   ` kotee
  0 siblings, 0 replies; 4+ messages in thread
From: kotee @ 2001-11-13 16:07 UTC (permalink / raw)


In article <slrn9v0b3e.5h0.randhol+abuse@kiuk0156.chembio.ntnu.no>, Preben Randhol <randhol+abuse@pvv.org> writes:
> On 12 Nov 2001 19:48:45 +0100, kotee@ludens.elte.hu wrote:
>> hi all
>> 
>> i write my own data type, but i need an "=" operator for it.
>> i know that generic packages can get functions as
>> parameter. how it works exactly? i try to find out
>> from ref guides, but i don't find it. :((
> 
> Don't read ref. books, read a text on Ada book. Here are some online.
> 
> http://www.it.bton.ac.uk/staff/je/adacraft/
> http://burks.bton.ac.uk/burks/language/ada/ada95.pdf
> 
> http://www.adapower.com/learn/adadistilled.html
> 
> Preben

thanks a lot, i found what i need!

kotee



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

end of thread, other threads:[~2001-11-13 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-12 18:48 function to generic kotee
2001-11-12 19:02 ` Preben Randhol
2001-11-13 16:07   ` kotee
2001-11-12 20:11 ` Matthew Heaney

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