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,1e514fb9f9333128 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-11 14:46:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!fu-berlin.de!uni-berlin.de!71102-cm.able.ES!not-for-mail From: Jano <402450@cepsz.unizar.es> Newsgroups: comp.lang.ada Subject: Re: Problem with access types using Booch components. Date: Tue, 11 Feb 2003 23:46:57 +0100 Message-ID: References: <5d6fdb61.0302111021.73b4bc4a@posting.google.com> NNTP-Posting-Host: 71102-cm.able.es (212.97.171.102) X-Trace: fu-berlin.de 1045003617 44824463 212.97.171.102 (16 [49872]) X-Newsreader: MicroPlanet Gravity v2.50 Xref: archiver1.google.com comp.lang.ada:34009 Date: 2003-02-11T23:46:57+01:00 List-Id: En el mensaje , simon@pushface.org dice... Hello, > What compiler/version are you using? I'm using Gnat 3.15p > With GNAT 3.15p I get this to compile without complaint (and to run, > though it's not a thorough test!). Mmm, I get it also to compile, it's only at runtime that I get the Constraint_error exception raised, saying "tag check failed" or the like (sorry, I'm not at work where I have the sources to quote it exactly) > Note the 'Class .... I've noted it. Really, I was following the example in the docs very closely because I've just begun to try it. Your example below it's exactly what I have, but I have it splitted across some packages. I find it strange, specially because of the error going away when I assign the access to a local container. Uhm! I see now a difference. You are getting the iterator from CU, which is the unit who contains the type Collection. In the example in the docs (and in my program) I'm getting the Iterator from the top abstract_container. I suppose dispatching takes care of this? But what about the different behavior in my case when using the access or the local container? Thanks anyway, I'll try tomorrow to use the CU-level package... > with Collection_Test_Support; > > procedure Jano is > > use Collection_Test_Support; > > type CU_P is access all CU.Collection; > > C : aliased CU.Collection; > CP : CU_P := C'Access; > > begin > > declare > It : Containers.Iterator'Class := CU.New_Iterator (CP.all); > begin > null; > end; > > end Jano; -- ------------------------- Jano 402450[at]cepsz.unizar.es -------------------------