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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.92.226 with SMTP id cp2mr109535103obb.20.1452463119571; Sun, 10 Jan 2016 13:58:39 -0800 (PST) X-Received: by 10.182.112.202 with SMTP id is10mr1160952obb.7.1452463119547; Sun, 10 Jan 2016 13:58:39 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h5no2752262igh.0!news-out.google.com!kr2ni1321igb.0!nntp.google.com!h5no2752253igh.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 10 Jan 2016 13:58:39 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:18f:900:8350:ba86:87ff:fed6:5907; posting-account=3pYsyQoAAACcI-ym7XtMOI2PDU8gRZS5 NNTP-Posting-Host: 2601:18f:900:8350:ba86:87ff:fed6:5907 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Instantiating package problems From: Andrew Shvets Injection-Date: Sun, 10 Jan 2016 21:58:39 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:29080 Date: 2016-01-10T13:58:39-08:00 List-Id: On Sunday, January 10, 2016 at 4:50:15 PM UTC-5, Georg Bauhaus wrote: > 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); > }; Thanks for your reply. I understand now.