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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,12a63150f4f961a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.231.2 with SMTP id tc2mr2525860pbc.8.1336095674003; Thu, 03 May 2012 18:41:14 -0700 (PDT) Path: pr3ni1329pbb.0!nntp.google.com!news2.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: BrianG Newsgroups: comp.lang.ada Subject: Re: OOP in Ada: Alternatives for "protected" scope Date: Thu, 03 May 2012 21:41:05 -0400 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Date: Fri, 4 May 2012 01:41:13 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="5MNoRlpIAhOS/jy0qxZerw"; logging-data="6919"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/hngzS4fvJzEgaxvQmJ8t5" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16 In-Reply-To: Cancel-Lock: sha1:pe/OODX2zh9a303pl55nlVMs4lg= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-05-03T21:41:05-04:00 List-Id: On 05/03/2012 05:27 PM, Felix Krause wrote: ... > > The function Calculate should only be used internally. I do not see a > good way to enforce this with Ada: I do not want to move it to P_A's > private part, because child classes of A should not be required to be > located in sub-packages of P_A. Since those other languages' Class is equivalent to a combination of Ada's Tagged Type, associated Primitive Operations (etc.), and containing Package (i.e. "Class" provides the container and name-space, part of the other-language definition of "OOP", which Ada provides in a more general way with Packages), this is equivalent to saying those languages should not require a derived type to be contained within a Class derived from the parent. -- --- BrianG 000 @[Google's email domain] .com