comp.lang.ada
 help / color / mirror / Atom feed
From: Ulrich Eckhardt <uli.e@gmx.de>
Subject: Re: problem with abstract types
Date: Thu, 31 Oct 2002 15:35:37 +0100
Date: 2002-10-31T15:35:37+01:00	[thread overview]
Message-ID: <r3frpa-ja1.ln@uli.uli-eckhardt.de> (raw)
In-Reply-To: mailman.1036071182.3072.comp.lang.ada@ada.eu.org

David C. Hoos wrote:

>>package registry is
>>   type registry is abstract tagged limited private;
>>   type registry_Access is access all registry'Class;
>>
>>   procedure openRegistry(reg : in out registry; ..) is abstract;
>>   function getRegistry( .. ) return registry_Access
>>   [..]

>>  package registry.unix is
>>     type file_registry is new registry with private;
>>     procedure openRegistry(reg : in out file_registry; ..);  
>>     [..]
>>
>>Any hints what i am missing, or comments how such things are better
>>done in ada?
> 
> This problem has nothing to do with abstract types. The error message means
> exactly what it says.  So, what is the prefix of the "access" attribute?
> It's "reg" so, "reg" must be aliased.

Yes and no ;-). The above fixes the compiler error, but not my
problem.

> All of that being said, the bigger question is "why do you want to take the
> "access" attribute of an access value?

Thats exact my problem. I have no idea how to do it a better way.
I use the package registry as some sort of interface, which sould
make sure that for every instance a set of functions are declared.

But i can not or don't know how to declare an abstract type
and assign later on a real type which is derived from this type.
For example on java i can create an abstract type and also declare
a variable of an abstract type. Later on the programm i can then
instantiate a real type an assign it to this variable. Thats what i
now want to do in java.

Uli
-- 
Ulrich Eckhardt
http://www.uli-eckhardt.de




  parent reply	other threads:[~2002-10-31 14:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-31 12:06 problem with abstract types Ulrich Eckhardt
2002-10-31 13:15 ` John English
2002-10-31 14:43   ` Ulrich Eckhardt
2002-10-31 17:18     ` Robert I. Eachus
2002-10-31 18:20       ` Jeffrey Carter
2002-10-31 20:58         ` Robert I. Eachus
2002-11-01 10:57       ` Ulrich Eckhardt
2002-11-01 12:05         ` Simon Wright
2002-11-01 17:03           ` Robert A Duff
2002-11-04 15:18             ` Robert I. Eachus
2002-11-04 16:14               ` Robert A Duff
2002-10-31 13:32 ` David C. Hoos
2002-10-31 13:47   ` problem with posters Peter Hermann
2002-10-31 14:15     ` Preben Randhol
2002-10-31 14:35   ` Ulrich Eckhardt [this message]
2002-11-01  8:31     ` problem with abstract types Dmitry A.Kazakov
2002-11-01 11:32       ` Ulrich Eckhardt
2002-10-31 15:31 ` Simon Wright
2002-10-31 17:22 ` Stephen Leake
2002-11-01 10:25   ` Ulrich Eckhardt
2002-11-04 14:30     ` Ted Dennison
2002-11-04 15:08     ` Ulrich Eckhardt
2002-11-04 15:32       ` Stephen Leake
2002-11-04 17:12         ` Ulrich Eckhardt
2002-11-04 17:43           ` David C. Hoos
2002-11-04 19:34             ` Ulrich Eckhardt
2002-11-04 19:54             ` Stephen Leake
2002-11-04 20:08             ` Robert A Duff
2002-11-01 11:15   ` Preben Randhol
2002-11-01 17:21     ` Stephen Leake
replies disabled

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