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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56db82f3595e6f1e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-06 04:23:39 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: oo programing help needed? Date: Sat, 6 Dec 2003 12:23:38 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <4948f537.0312060221.6edfa391@posting.google.com> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1070713418 17456 134.91.1.34 (6 Dec 2003 12:23:38 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Sat, 6 Dec 2003 12:23:38 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: archiver1.google.com comp.lang.ada:3175 Date: 2003-12-06T12:23:38+00:00 List-Id: shoko wrote: : i have the following: : ------------------------------------------ : package one is : type one is tagged private; : type one_ptr is access all one'class; : : procedure set_name(name:String;this:in out one); : function get_name(this:one) return string; : : private : type one is tagged : record : name:String(1..256); : end record; : : : end one ; ... : ------------------------------------------- : package body three is : function get_name(this:three) return string : s:string(1..10); : begin : return s+ this.name; <-- no selector "name" for type three : end get_name; In the definition of one in package one, you have chosen to hide .name from view. But then you select a .name component from within the body of package three, which as a package is just any package, and thus cannot see the private part of package one. (You could use get_name in three because it is not in the private part of one. This might be a good thing to do anyway as it respects the contract for dealing with ones using one's public operations.) -- Georg