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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,699cc914522aa7c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Structured exception information Date: Tue, 16 Jan 2007 16:48:35 +0100 Message-ID: <514adpF1i6us0U1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: individual.net lNFHjtgjiW/yjDFX4PFUYweAJBiB5XDphcgzN8qBBqr0ksxvg= User-Agent: KNode/0.10.4 Xref: g2news2.google.com comp.lang.ada:8178 Date: 2007-01-16T16:48:35+01:00 List-Id: Maciej Sobczak wrote: > BTW - How can I ensure in a general way that the constructor function > must be used to initialize the object, otherwise compile-time error is > reported? > If I make My_Type a discriminated type (so that the discriminant value > is used in the default initialization), does it limit anything, like > constructor parameter types? You can use a fake discriminant this way: package ... type Blah (<>) is private; private type Blah is ...; end That is, you say to the world that the type has discriminants, so it can't be declared uninitialized. Internally, you don't have discriminants nor any limitation derived from them.