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,48fa8e3cfaec41af X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-22 11:12:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: worth the hassle? Date: 22 Jul 2002 14:06:31 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1027361720 5598 128.183.220.71 (22 Jul 2002 18:15:20 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 22 Jul 2002 18:15:20 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:27308 Date: 2002-07-22T18:15:20+00:00 List-Id: "chris.danx" writes: > hmm, problem... > > > Let's say we have 2 types (a_type & b_type) derived from a single type, > base_type and we want to store objects of all three types in the *same > list*. How do we code assign for this situation? What happens if the > derved classes are not known before hand? Is it even possible to put the > all the types in the same list? Use a class-wide access type in the list: type Element_Access is access all Element_Type'class; To mangle someone else's quote: "there is almost no problem in computer science that a layer of indirection won't solve". -- -- Stephe