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 19:49:11 +0100
Date: 2003-02-11T19:49:11+01:00	[thread overview]
Message-ID: <MPG.18b36414fe0fe8f989692@News.CIS.DFN.DE> (raw)
In-Reply-To: 5d6fdb61.0302111021.73b4bc4a@posting.google.com

En el mensaje <5d6fdb61.0302111021.73b4bc4a@posting.google.com>, 402450
@cepsz.unizar.es dice...
> Hello, I'm trying to use these and I've come across this problem.
> 
> Say I have a Collection type completely instantiated:
> 
> subtype Collection_x is Abstract_x_collections.Collection;

Sorry, my typo: this subtype renames the one contained in the third 
instantation:

Package Abstract_container is new...
Package Abstract_collection is new...
Package X_collections is new...

subtype Collection_x is X_collections.Collection;

> 
> and I define
> 
> type Collection_x_access is access all Collection_x;
> 
> Now I have a
> 
> C: Collection_x;
> C_access: Collection_x_access:= C'access;
> 
> All works well until I try to create an iterator:
> 
> first try:
> it: Iterator:= New_iterator(C_access.all); <-- it raises tag error
> inside some booch source.
> 
> second try:
> it: Iterator:= New_iterator(Collection_x(C_access.all)); <-- same as
> above.
> 
> third try:
> C_bis: Collection_x:= C_access.all;
> it: Iterator:= New_iterator(C_bis); <-- It works!!
> 
> I would go with the first option.
> 
> I'm 99% sure that I'm calling the proper functions in the proper
> packages, but if anyone demands it, I can post a more detailed example
> with actual code.
> 
> What's happening??
> 
> (In a side note, in the first of the three calls, if I replace
> C_access.all by
>  C_access (yes!), Gnat compiles without complaint...)
> 
> Regards,
> 
> Alex.
> 

-- 
-------------------------
Jano
402450[at]cepsz.unizar.es
-------------------------



  reply	other threads:[~2003-02-11 18:49 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 [this message]
2003-02-11 20:42 ` Simon Wright
2003-02-11 22:46   ` Jano
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