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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Mixing public and private member of a class. Dealing with what to hide and not Date: Wed, 13 Feb 2019 21:39:22 +0100 Organization: Adalog Message-ID: References: <5e42642d-3dd4-4c53-8b24-50bde70485f8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 13 Feb 2019 20:39:22 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="dbbff2da127c57f65920c8511db44a93"; logging-data="3687"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vgEGU+FHh1ZenJhSSz5eG" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 Cancel-Lock: sha1:Bqr6ZYqZK1YtI39sIv/D2MYUwqQ= In-Reply-To: <5e42642d-3dd4-4c53-8b24-50bde70485f8@googlegroups.com> Content-Language: fr Openpgp: preference=signencrypt Xref: reader01.eternal-september.org comp.lang.ada:55511 Date: 2019-02-13T21:39:22+01:00 List-Id: Le 13/02/2019 à 18:40, Daniel Norber a écrit : > I'm having big troubles in how Ada deals mixing public and private member of a class. > I'm not sure if this is really your problem, but since you are new to Ada, let me explain this. In Ada, the fundamental building block is the type. Every property is attached to a type. Unlike C++, being public or private is not a property of a member, but a property of the member's type. Hence you can do: package Pack is type Secret_Data is private; type Instance is tagged record My_Public: Some_Public_Type; My_Secret: Secret_Data; end record; ... -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr