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-Thread: 103376,7f854d193f44af15,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: "Rick Santa-Cruz" Newsgroups: comp.lang.ada Subject: access private element of base-class Date: Fri, 1 Oct 2004 02:35:22 +0200 Organization: T-Online Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1096591038 02 20399 utNkXPbv16KbSiYt 041001 00:37:18 X-Complaints-To: usenet-abuse@t-online.de X-ID: S1zUWqZL8eGYbQHwNO8F5LLTFSm5hN0K-NAtCIVIpGnsKvlRRGZag7 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:4474 Date: 2004-10-01T02:35:22+02:00 List-Id: Hi, again something with Ada is unclear to me. In the thread: http://groups.google.de/groups?q=ada+protected+c%2B%2B&hl=de&lr=&ie=UTF-8&selm=slrn8ljk2n.qv2.gisle%40struts.ii.uib.no&rnum=6 I read, that the Ada-private is more similar to protected than to C++ private, so I tried the following: -- specification of Base-Class package Base_Class is type Base is tagged private; private type Base is tagged record Number: Integer; end record; end Base_Class; -- specification of Derived-Class with Base_Class; use Base_Class; package Derived_Class is type Derived is new Base with private; procedure Derived_Proc(D: in out Derived; Num :Integer); private type Derived is new Base with null record; end Derived_Class; -- body of Derived-Class package body Derived_Class is procedure Derived_Proc(D: in out Derived; Num :Integer) is begin D.Number := Num; -- here I get a compiler error. Why? end Derived_Proc; end Derived_Class; Why can't I access Number which is a private-Element of the Base-Class? Thanks for any help, Rick