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-Thread: 103376,2e2db8edf2656165 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: Matthew Heaney@MHEANEYIBMT43 Newsgroups: comp.lang.ada Subject: Re: Constructing an object References: From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 23 Sep 2005 12:36:05 GMT NNTP-Posting-Host: 24.149.57.125 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1127478965 24.149.57.125 (Fri, 23 Sep 2005 05:36:05 PDT) NNTP-Posting-Date: Fri, 23 Sep 2005 05:36:05 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:5059 Date: 2005-09-23T12:36:05+00:00 List-Id: "Dmitry A. Kazakov" writes: > Replace it with: > > type Shape (<>) is private; Yes, but now the type is indefinite, which means you can't declare it as a component of a composite type. (This is no different from C++, when you hide the default ctor.) The easiest thing is just to default initialize the component(s), and don't bother declaring the type as indefinite. If you still want to force some post-declaration initialization, then you do something like: type Color_Base is (Uninitialized, Red, Black); subtype Color is Color_Base range Red .. Black; type Shape is tagged private; procedure Set_Color (S : in out Shape; C : Color); ... private type Shape is tagged record C : Color_Base := Uninitialized; end record; ... end Shapes; But again, that would only be necessary if you don't have a sensible default. In this particular case, you probably don't need to bother; just pick on of the colors as the default.