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,342dcd67e9ca73ee X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 13 Sep 2005 02:56:02 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: tagged record child: override constructor? References: <1uri5gd2n7om0.1ujkzb26ayxdx.dlg@40tude.net> X-Newsreader: Tom's custom newsreader Message-ID: <5OWdnSyaUoWPG7veRVn-qQ@comcast.com> Date: Tue, 13 Sep 2005 02:56:02 -0500 NNTP-Posting-Host: 24.6.102.223 X-Trace: sv3-xGGdO2V1kBKQy4/7ypkcg4U5e7GettD9Cw673xD6s+bxJA3djI+zeDzvWPMOC3CR5C5R1+iaNTW1g4v!rNNqYn86DClvzGOTPPsNYf6QqMNhQlcowKUBq1ZlYQU2tfG6hmpMPT96sLPhOASkgr5ibUMBkk4/ X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:4602 Date: 2005-09-13T02:56:02-05:00 List-Id: > type X is tagged private; > -- Publicly tagged to have an ability to declare class-wides > function Create (...) return X'Class; If you then have type Y is new X ... then function Create will of course still return an X, not a Y unless you make a new Create that knows how to return a Y. > constructor function which returns an instance. I do this to enforce > the assignment of several required fields in the record, so if you know > how to do this another way, please let me know! Make X a child of Ada.Finalization.Controlled (as suggested) and writing an Initialize doesn't work? Or can you simply make those required fields discriminants? type X(Required_A, Required_B : Integer) is ...