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,b14a804025dceb20 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-10-30 03:38:53 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!xfer13.netnews.com!netnews.com!newspeer1.nac.net!news.mv.net!world!bobduff From: Robert A Duff Subject: Re: Constructors/Destructors in Ada95 Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Mon, 30 Oct 2000 11:36:58 GMT References: <39EE160D.F0A2000@bigfoot.com> <39EF5431.BF4CD793@bigfoot.com> <39F0A6C7.E592AFFB@averstar.com> <39F4AE95.4DB04145@bigfoot.com> <39F9C5E5.29FE98CF@bigfoot.com> Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: supernews.google.com comp.lang.ada:1625 Date: 2000-10-30T11:36:58+00:00 List-Id: Francois Godme writes: > Take for example, the class Person. There are no such things as a > default birth date, a default sex or a default eyes color for > instances of the class Person. To provide methods to later fix the > birth date, the sex and the eyes color to appropriate values opens up > instances to mistakes. These three instance attributes should be > constant and hence initialized by the constructor. You can use "(<>)" as the discriminant part to prevent default initialization. Then initialize the thing with a function call. (But as you or somebody pointed out, this unfortunately does not work for limited types.) - Bob