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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Instantiating package problems Date: Sun, 10 Jan 2016 22:50:13 +0100 Organization: A noiseless patient Spider Message-ID: References: <7dcd49f3-b04f-4ea3-b431-5c27f73b9afe@googlegroups.com> <87poxixqmy.fsf@theworld.com> <112f5e6c-35c1-483a-b8dd-24f5f76dc6ce@googlegroups.com> <084197af-8e37-4250-a083-b45bd9ab4609@googlegroups.com> <5a81226f-e719-4ca8-8cbc-d02cf4ab56e7@googlegroups.com> <768bb8bd-ed12-4235-a663-fa71fcb42795@googlegroups.com> <2ae043b6-e745-4f27-a9ab-cc183a25ca56@googlegroups.com> <6583d5e1-2d8b-4c90-bb9d-9673061e76c7@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 10 Jan 2016 21:47:32 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="39de15b3e86de6f11efc1110fce496c9"; logging-data="25529"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jHua7DrbSSFCzPUHvV/Ae76qk188ptE0=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 In-Reply-To: <6583d5e1-2d8b-4c90-bb9d-9673061e76c7@googlegroups.com> Cancel-Lock: sha1:DbtzZHaoHD8gESyDmiKsNCiLBLQ= Xref: news.eternal-september.org comp.lang.ada:29079 Date: 2016-01-10T22:50:13+01:00 List-Id: On 10.01.16 20:43, Andrew Shvets wrote: > > When you instantiate a record (which is described in the private portion of a package), does that mean that the insides (the different types, lists, arrays, etc.) that compose it are not visible to others except through setter and getter methods? > when a type is declared as a private type in some page P, package P is type T ... is ... private; then, outside the package, only public operations are visible, basically anything that follows the declaration until another "private" introduces the private part of P. Hence, no data components of any object of type P.T declared outside. Suppose package P is type T is private; procedure op1 (Object : in out T); private type T is record c1 : T1 := Foo(N); c2 : T2; end record; end P; then I think it is fair to say this C++ type is an analogue, perhaps declared in a file "p.hpp", or in namespace P: struct T { private: T1 c1; T2 c2; public: T() : c1(foo(n)) { } void op1(void); };