comp.lang.ada
 help / color / mirror / Atom feed
From: axu@rdsnet.ro (Alex Crivat)
Subject: Indexed list
Date: 15 Aug 2003 04:46:24 -0700
Date: 2003-08-15T11:46:24+00:00	[thread overview]
Message-ID: <3922594d.0308150346.65657e94@posting.google.com> (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;



             reply	other threads:[~2003-08-15 11:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-15 11:46 Alex Crivat [this message]
2003-08-15 13:01 ` Indexed list Lutz Donnerhacke
2003-08-15 23:57 ` Matthew Heaney
replies disabled

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