comp.lang.ada
 help / color / mirror / Atom feed
From: Jano <402450@cepsz.unizar.es>
Subject: Re: Problem with access types using Booch components.
Date: Tue, 11 Feb 2003 23:46:57 +0100
Date: 2003-02-11T23:46:57+01:00	[thread overview]
Message-ID: <MPG.18b39bca994daf55989693@News.CIS.DFN.DE> (raw)
In-Reply-To: x7vsmuu7dn9.fsf@smaug.pushface.org

En el mensaje <x7vsmuu7dn9.fsf@smaug.pushface.org>, 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
-------------------------



  reply	other threads:[~2003-02-11 22:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-11 18:21 Problem with access types using Booch components Jano
2003-02-11 18:49 ` Jano
2003-02-11 20:42 ` Simon Wright
2003-02-11 22:46   ` Jano [this message]
2003-02-12  9:06     ` Jano
2003-02-12 21:57       ` Simon Wright
2003-02-13 19:07         ` Jano
replies disabled

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