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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,399666c22a39304c X-Google-Attributes: gid103376,public From: Richard Irvine Subject: Re: Translate this into Ada ... Date: 1996/08/21 Message-ID: <321AFC20.5586@eurocontrol.fr>#1/1 X-Deja-AN: 175563704 references: <4ved8g$att@Masala.CC.UH.EDU> content-type: text/plain; charset=us-ascii organization: Eurocontrol Experimental Centre, Bretigny-Sur-Orge, France mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; HP-UX A.09.05 9000/755) Date: 1996-08-21T00:00:00+00:00 List-Id: Spasmo wrote: > > Richard Irvine (Richard.Irvine@eurocontrol.fr) wrote: > : Can anyone help with what I imagine is a frequently ocurring problem? > > : We would like all lists in an application to be read using an iterator > : with operations like: > > [Snip] > > Well I'm no expert in Ada, but I have successfully written > generic linked list routines that pretty much do what you want. > Here's some info, but if you would like the actual source code > I'd be more than happy to provide it (I haven't done all that > much debugging but it seems to work and at the very least should > give you an idea of how to proceed). > Thanks for your reply which concerned a particular implementation of a generic list. What I was really trying to get at was how to produce an abstract specification of a list which MANY implementations (e.g. singly-linked lists, arrays etc. ) might conform to. In our case we are tyring to develop a subsystem which may be embedded in many client applications (none of which is written in Ada!). The client applications will provide us with lists (collections) and we have no idea how they will be implemented. Nonetheless, we would like to have some way of ensuring that the different lists provided by the client (and by ourselves) are accessed in a consistent way. The problems come because the function which creates the iterator refers to two asbtract types. (Doubly dispatching). For a concrete implementation one might make use of David Weller's Booch components, for example.