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,28efdda00d725591 X-Google-Attributes: gid103376,public From: John English Subject: Re: Lists Date: 2000/03/22 Message-ID: <38D8F2C9.691B6CCB@bton.ac.uk>#1/1 X-Deja-AN: 601120949 Content-Transfer-Encoding: 7bit References: <003b01bf92ac$6c14dcc0$97c2f4d8@andrs> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@bton.ac.uk X-Trace: saturn.bton.ac.uk 953741826 12518 193.62.183.204 (22 Mar 2000 16:17:06 GMT) Organization: University of Brighton Mime-Version: 1.0 NNTP-Posting-Date: 22 Mar 2000 16:17:06 GMT Newsgroups: comp.lang.ada Date: 2000-03-22T16:17:06+00:00 List-Id: Fortier Andres wrote: > Hi, > I need to make a package that contains a sort of heterogeneous list. > This is the deal: > There is a hierarchy of objects, and all of them are > subclasses of Object. I need the list to be able to hold any object of that > hierarchy, but the idea is not to have to instantiate a package for every > type the list is going to hold. > Any idea? What you need is a list of pointers (whoops, access types :-) to Object'Class objects. Or put a pointer to Object'Class in every Object, and have operations to add an Object to a list, then derive from Object as required. A list of pointers is easier and more general IMHO. ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------