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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,de6de6cc35dca537 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: What is derived? Date: Sun, 03 Oct 2004 18:54:45 +0200 Organization: AdaCL Message-ID: <3010113.uZPRfhq3jA@linux1.krischik.com> References: Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1096823473 05 23677 gduPX36L95dFB4I 041003 17:11:13 X-Complaints-To: usenet-abuse@t-online.de X-ID: EeDiZ+ZDgepEsTltLCLU1QqNHkPmeLHAqRRKIDO8OAP3v052xQo28D User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:4610 Date: 2004-10-03T18:54:45+02:00 List-Id: Rick Santa-Cruz wrote: > Hi, > > thanks for your answer! > >>> At least I think, that private-methods are inherited, or am I wrong? >> >> If by "private-methods" you mean "subprograms declared in the private >> part of the package spec", then yes and no. They will be derived if >> they are visible at the point of derivation. > What do you mean with visible at the point of deriviation? For example if > a procedure is declared after the a type is derived, then is this > procedure not visible? Are there more special cases? Remember that private work on child packages and not on child classes. So a child class which is inside a child packages can see procedures declared inside private. A child class declared in an unrelated package can not see the private part and therefore cannot inherit private procedures. If you are a C++ convert then I suggest to declare all child classes in child packages - that make transition easier for you With Regards Martin. PS: The following creates a class where the outsild world does not know it is OO. Favourite example is Unbounded_String. Since Unbounded_String may not leak memory and almost no Ada compiler implements garbage collection it needs some form of destructor. Therefore Unbounded_String is internally a class. package Hidden_Tag type Object is private; private type Object is tagged private; end Hidden_Tag; -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com