From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,db9fec59d36b64c1,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-15 04:46:25 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: axu@rdsnet.ro (Alex Crivat) Newsgroups: comp.lang.ada Subject: Indexed list Date: 15 Aug 2003 04:46:24 -0700 Organization: http://groups.google.com/ Message-ID: <3922594d.0308150346.65657e94@posting.google.com> NNTP-Posting-Host: 81.196.244.218 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1060947984 5181 127.0.0.1 (15 Aug 2003 11:46:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 15 Aug 2003 11:46:24 GMT Xref: archiver1.google.com comp.lang.ada:41496 Date: 2003-08-15T11:46:24+00:00 List-Id: 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;