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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d58fe1ff04da7fd7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-15 06:55:03 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Ambiguous reference - What is wrong with this? Date: Wed, 15 Aug 2001 09:49:14 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9ldukt$a5n$1@nh.pace.co.uk> References: <9lbf8n$brf$1@nh.pace.co.uk> <9lbo1h$2bhq$1@ns.felk.cvut.cz> <9lc0jf$hod$1@nh.pace.co.uk> <9ld8su$eak$1@ns.felk.cvut.cz> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 997883357 10423 136.170.200.133 (15 Aug 2001 13:49:17 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 15 Aug 2001 13:49:17 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:11949 Date: 2001-08-15T13:49:17+00:00 List-Id: O.K. I think I've got it. At the first level of derivation, I've rather implicitly created a Derive1/Base'Class procedure which looks essentially the same as a Derive1/Derive1'Class procedure because, after all, a Derive1'Class is also a Base'Class. The attempt to resolve it doesn't work because there are, in effect, two procedures in the package spec - one that I visibly created and one that is automagically created. So basically, I can get away with this if I only go to one level of derivation, but the next level up is going to see duplicate procedures below it. Well, I'll need to ponder this for a while & see what alternative approaches I might take. Generics suggest one possible answer, but I don't find it as clean as an abstract tagged type for bringing in lots of user defined functions. Whatever happens, I think I'm in a position where I have to do some major restructuring of what I've got so far. Bummer, dude! :-( MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Sergey Koshcheyev" wrote in message news:9ld8su$eak$1@ns.felk.cvut.cz... > > "Marin David Condic" wrote in > message news:9lc0jf$hod$1@nh.pace.co.uk... > > Hmmmmmm........ I *think* I understand. This may take a bit of pondering. > > Well, I should have explained that better, let me try it once more :-) > The problem is that you're overloading instead of overriding. And the > problem occurs because when Some_Proc is inherited for type Derive1, it > turns from > procedure Some_Proc > (Object : in out Base; > Object2 : in out Base'Class); > to > procedure Some_Proc > (Object : in out Derive1; > Object2 : in out Base'Class); > (note that the type of the Object2 parameter doesn't change) > so the Some_Proc you define doesn't override it. > > > In any event, it isn't clear how I get out of it considering thatI'd kind > of > > like to keep the second parameter a 'Class wide type. > > Ada is not covariant, so I'm quite sure an approach using tagged types for > both the containers and the elements (in the context of your problem) won't > work. > > > > > down can't hide some operation of one of its parents. I'd like to be able > to > > say my list can only accept elements of some subclass and increasingly > > restrict that subclass (see other posts in this thread.) By removing the > > I think that having the root list package generic and adding new generic > parameters to child packages (and thus adding requirements for the stored > type) might work, but I haven't tested it and I don't know if it will be > appropriate for the problem you're solving. I can provide an example of what > I have in mind, if needed. > > Sergey. > >