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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,555956c1cdd22308 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Help - Constructors - ASAP. Date: 1998/07/31 Message-ID: #1/1 X-Deja-AN: 376800814 References: <6p75qi$rcj@news.latnet.lv> <6pi4jq$j73$1@nnrp1.dejanews.com> <6pqdr2$hn2$1@nnrp1.dejanews.com> <35C1043E.9FFB23D0@elca-matrix.ch> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1998-07-31T00:00:00+00:00 List-Id: tedennison@my-dejanews.com wrote: > But what happens in the situation where the client (perhaps a > different developer) wants to make a child class with fields that > *must* be initialized? That seems a quite reasonable thing to > do. But now the class-wide "constructor" isn't valid anymore. It > can still be called for this new child object, but will return a > garbage value. Note that there ARE cases where you do want to have a dispatching constructor. In those cases you really do want to have a constructor that is derived, and you (or someone else) will have to do the explicit overriding. Using records with default initial values can make this fairly painless, but you want to have derivation trees that are wide instead of deep. (You can even use generics to create the instances.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...