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,88093378be1184d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-08 13:51:35 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!ppp-2-11.cvx2.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: List Container Straw Man Date: Thu, 8 Nov 2001 19:09:37 -0000 Message-ID: <9seup4$12h0ar$3@ID-25716.news.dfncis.de> References: <9s941p$11mrei$4@ID-25716.news.dfncis.de> <9s99tt$pdb$1@nh.pace.co.uk> <9s9s8p$11vt7l$1@ID-25716.news.dfncis.de> <9sc5l8$9b7$1@nh.pace.co.uk> <9scke8$12jb14$3@ID-25716.news.dfncis.de> <9sdnva$dpk$1@news.huji.ac.il> NNTP-Posting-Host: ppp-2-11.cvx2.telinco.net (212.1.141.11) X-Trace: fu-berlin.de 1005256293 36208987 212.1.141.11 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:16099 Date: 2001-11-08T19:09:37+00:00 List-Id: "Ehud Lamm" wrote in message news:9sdnva$dpk$1@news.huji.ac.il... > ... > Am I right in _comparing_ (not equating) your approach to having an ancestor > type like Object or ANY, that all element types are derived from - thus > ensuring a common interface? Not really. My approach (as Ted's) uses generic packages instantiated with the element type. I use a hierarchy of tagged types to represent iterators (of gradually increasing complexity) based on that element type: it is this which ensures a common (iterator) interface. Typeless (nominally typeless), and 'reflective', languages, such as Smalltalk, can get away with having containers based on a single root element class, because the containers are always able to adapt sufficient to cope with any element object thrown at them. Ada is not like this. As regards my proposal, the element type must be definite. However, nothing stops it being an access-to-classwide type: type Object_Ref is access all Object'Class; allowing stores to deal, indirectly, with objects of all sorts whose types are derived from Object.