comp.lang.ada
 help / color / mirror / Atom feed
* Indexed list
@ 2003-08-15 11:46 Alex Crivat
  2003-08-15 13:01 ` Lutz Donnerhacke
  2003-08-15 23:57 ` Matthew Heaney
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Crivat @ 2003-08-15 11:46 UTC (permalink / raw)


Say I have a generic package wich implements a doubly linked list.
What I want to do, and I could not find a way to do it, is to use this
list as an array with the posibility of using the index operator "()"
(I know, in ada this is not used as an operator).
For example in C++ language I can do this by overloading the "[]"
operator. So when I call the list with this operator and a interer
index as parameter it returns the element coresponding to that index.

Example:
A : ITEM;
L : DLIST; -- DLIST is a list of ITEM type elements;

And I want to be able to do something like:
A := L(3); -- wich will put in A the fourth element of my list.

Is there a way of doing this in Ada using operators or should I use a
custom function;



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

end of thread, other threads:[~2003-08-15 23:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-15 11:46 Indexed list Alex Crivat
2003-08-15 13:01 ` Lutz Donnerhacke
2003-08-15 23:57 ` Matthew Heaney

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