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 20:24:31 +0100 Organization: cbb software GmbH Message-ID: <11g6tx7vp2vyt$.1nqxaiwl27g56$.dlg@40tude.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net yadBW/3KlUnQzfiCKHljqwDp8Tzennbl/7waZmS2LrgAn6GzU= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:6908 Date: 2004-12-12T20:24:31+01:00 List-Id: On Sun, 12 Dec 2004 18:40:40 GMT, Jeffrey Carter wrote: > If you're interested in interpreting the same bit pattern as 2 different > types, this is not the mechanism Ada uses. Use Unchecked_Conversion instead. Right, especially because the value of the discriminant will be a *part* of the record. Same is true if you'll try to achieve it using class-wide types. Type tag will be a part of T'Class. In short, Ada maintains consistency of values and views. Unchecked_Conversion is mainly to circumvent it. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de