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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af92cb4b0cc736af X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-31 06:50:03 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!proxad.net!fr.usenet-edu.net!usenet-edu.net!bnewspeer01.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!read.news.de.uu.net!not-for-mail Date: Thu, 31 Oct 2002 15:35:37 +0100 From: Ulrich Eckhardt Organization: Private at home User-Agent: Mozilla/5.0 (X11; U; Linux i686; en; Stable) Gecko/20020603 Beonex/0.8-stable X-Accept-Language: de, de-DE, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: problem with abstract types References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 1Cust38.tnt6.fft4.deu.da.uu.net X-Trace: 1036075627 read.news.de.uu.net 191 149.225.94.38 X-Complaints-To: abuse@de.uu.net Xref: archiver1.google.com comp.lang.ada:30258 Date: 2002-10-31T15:35:37+01:00 List-Id: 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