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,T_FILL_THIS_FORM_SHORT 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: "G.B." Newsgroups: comp.lang.ada Subject: Re: Declaring constants for a abstract tagged type and concrete sub classes Date: Tue, 7 Jul 2015 19:21:44 +0200 Organization: A noiseless patient Spider Message-ID: References: <0ade6abf-34c0-46e2-8bd9-d60a00056321@googlegroups.com> <28d2406c-d579-4710-9b34-108317fe9abf@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: Tue, 7 Jul 2015 17:20:20 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="27867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181bShwh9ZKFEK5FWQjAEgkMBw3HLGLj4Q=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 In-Reply-To: Cancel-Lock: sha1:MYZBzX/1mKS7K63K3YglVPBIox0= Xref: news.eternal-september.org comp.lang.ada:26684 Date: 2015-07-07T19:21:44+02:00 List-Id: On 07.07.15 18:27, Serge Robyns wrote: > Now I'm facing my other issue, how to "merge" the root and child part in a new No_Element ... This is about valid Ada syntax. > No_Element : constant T_Concrete := ( T_Root.No_Element, 789); If the derived type stays within the package hierarchy, i.e. in a child package (that's Abstract_Root.No_Element in the extension aggregate): ... private No_Element : constant Non_Abstract := Non_Abstract'(No_Element with Abc => -42); That is, one can start an extension aggregate with an expression supplying the T_Root stuff from the parent type. Or, ... private No_Element : constant Non_Abstract := Non_Abstract'(T_Root with Abc => -42); where T_Root stands for the type's defaults only. Outside the hierarchy, that could be ... private No_Element : constant Non_Abstract := Non_Abstract'(Abstract_Root.T_Root with Abc => -42); This presumes, then, that no_element-ness is fully determined by the component Abc here, since Abstract_Root.No_Element's private view is unavailable outside the package hierarchy and so can't be depended upon.