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,f9c7f7f00103ac6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-09 16:22:19 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!gw1.att.com!fnnews.fnal.gov!mp.cs.niu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!news.sprintlink.net!uunet!world!blanket.mitre.org!linus.mitre.org!spectre!eachus From: eachus@spectre.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: Constructor in ADA9X Date: 10 Feb 1995 00:22:19 GMT Organization: The Mitre Corp., Bedford, MA. Message-ID: References: <3h61fh$92n@rc1.vub.ac.be> NNTP-Posting-Host: spectre.mitre.org In-reply-to: stt@henning.camb.inmet.com's message of Wed, 8 Feb 1995 14:42:27 GMT Date: 1995-02-10T00:22:19+00:00 List-Id: In article stt@henning.camb.inmet.com (Tucker Taft) writes: > One last point -- sometimes you don't want a constructor > to be inherited, because the set of parameters it takes > is dependent on the specific type for which it was designed. > If you declare the constructor in the same package as the > associate type T, and it returns the type T, then it *will* > be inherited. One nice way to avoid undesired inheritance for > certain constructors is to put all such constructors in > a "child" package of the package where the original type > is defined. What Tucker said is perfectly correct, but may be misleading to novices. If a function has a controlling result (of a tagged type), then it must be overridden when inherited by a non-abstract type. (Hmmm... That is also pretty confusing. What Tucker is really saying is that in general in Ada 9X, you usually don't want to declare constructors where they will be inherited, because the person who declares a type derived from it may be forced to define a useless or "junk" constructor. You can have inherited constructors if you want, but usually you don't want.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...