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,e1e2bc096a996632 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: why can't we declare unconstrained objects ? Date: Sun, 12 Dec 2004 18:47:18 +0100 Organization: cbb software GmbH Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net Tp82BEhhCrvxZf1rW3Ny8QLSZZIQMEUOSnjfOWdndly0QHAmA= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:6904 Date: 2004-12-12T18:47:18+01:00 List-Id: On 12 Dec 2004 07:43:21 -0800, Michael Mounteney wrote: > Is there a simple way in Ada of simulating C/C++ unions ? It seems to > me that this is gratuitously prevented, that is, it can be done with > safety, by extending an existing run-time check, but it is in fact > prevented by the compiler. > > Hopefully the following commented source will illustrate my point. > > with Ada.text_IO; > > procedure unconstrained is > > -- Very simple discriminated type > type thing (what : Boolean) is Provide default: type thing (what : Boolean := False) is ... this will make it... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de