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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cc02cc67abeb4941 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-12 13:48:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!nntp.cs.ubc.ca!logbridge.uoregon.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Two questions Date: 12 Mar 2001 12:43:32 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 984419856 5368 128.183.220.71 (12 Mar 2001 17:57:36 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 12 Mar 2001 17:57:36 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 Xref: supernews.google.com comp.lang.ada:5657 Date: 2001-03-12T17:57:36+00:00 List-Id: Christoph Grein writes: > package something_cool is > > type cool is tagged private; > > function Create (P: in Some_Parameters) return Cool; -- gets abstract on > -- derivation > procedure Create (c : out cool; P: in Some_Parameters); -- does not get > -- abstract on > -- derivation > package constructor is -- nothing inside will be inherited > > procedure create (c : out cool; ... ... ); > > end constructor; > > private > ... > > end something_cool; > > Thus make your choice. As Randy said, you can end with a bunch of useless > constructors with the inherited ones. A bit more rationale: If you declare the constructors directly in the main package, they are "primitive operations of the type", and are thus inherited by derived types. This is usually not appropriate, since constructors for derived types will usually take more or different parameters. Declaring the constructors in a nested package makes them _not_ be primitive operations, so they are not inherited. Another option is to put them in a child package, but that means they can't take advantage of whatever is declared in the main package body. -- -- Stephe