comp.lang.ada
 help / color / mirror / Atom feed
From: John English <je@bton.ac.uk>
Subject: Re: Lists
Date: 2000/03/22
Date: 2000-03-22T16:17:06+00:00	[thread overview]
Message-ID: <38D8F2C9.691B6CCB@bton.ac.uk> (raw)
In-Reply-To: 003b01bf92ac$6c14dcc0$97c2f4d8@andrs

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
-----------------------------------------------------------------




       reply	other threads:[~2000-03-22  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <003b01bf92ac$6c14dcc0$97c2f4d8@andrs>
2000-03-22  0:00 ` John English [this message]
2000-03-23  0:00   ` Lists Ehud Lamm
2000-03-30  0:00 ` Multiprecisions numbers in ada DELCOURT J�r�me
2000-03-31  0:00   ` DELCOURT J�r�me
replies disabled

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