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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx21.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:30.0) Gecko/20100101 Thunderbird/30.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Type_Invariant and instance creation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Tue, 22 Jul 2014 01:13:04 UTC Organization: TeraNews.com Date: Mon, 21 Jul 2014 19:13:03 -0600 X-Received-Bytes: 1833 X-Received-Body-CRC: 753257335 Xref: news.eternal-september.org comp.lang.ada:21135 Date: 2014-07-21T19:13:03-06:00 List-Id: On 21-Jul-14 17:29, Randy Brukardt wrote: > I'd guess that both are wrong, although it may not have to do with this > example.:-) There's lots of issues with Type_Invariant (it seems SO > simple); we've pretty much given up on making it bullet-proof. We just > approved yet another AI on the topic (AI12-0042-1/09 -- 8 versions before > this one!) and I suspect that we haven't found all of the problems. Both > predicates and postconditions are in better shape, so I'd use them more than > type invariants. That's disappointing to hear. I was poking around the WordPerfect SDK [WPD format], and was thinking Type_Invariant would be perfect for that. Type File_Header is record Padding_Prefix : Interfaces.Unsigned_8; Signature : String(1..3); Document_Offset : Interfaces.Unsigned_32; --Product : Product_Type; Document_Type : File_Types; end record with Type_Invariant => File_Header.Padding_Prefix = 16#FF# AND File_Header.Signature = "WPC";