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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: A function that cannot be called? Date: Tue, 23 Oct 2018 13:45:25 +0200 Organization: A noiseless patient Spider Message-ID: References: <99f41210-6fe2-4b4d-90ad-21a0ab108f53@googlegroups.com> <39dec2d6-7da5-4421-bb50-e4effd5a1439@googlegroups.com> <104caa52-8e0b-4699-996e-74f382c31ba7@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 23 Oct 2018 11:45:26 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="537b2cbe902a8590459f9a1ec6abc86b"; logging-data="2330"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MD7AKToKwY2gYkIWgvu4AUiFyBbx1aNY=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 Cancel-Lock: sha1:hiUEuB9v6iccPaWp5tzd+lFi5dg= In-Reply-To: <104caa52-8e0b-4699-996e-74f382c31ba7@googlegroups.com> Content-Language: de-DE Xref: reader02.eternal-september.org comp.lang.ada:54695 Date: 2018-10-23T13:45:25+02:00 List-Id: On 21.10.18 13:30, Egil H H wrote: > package What is > pragma Assertion_Policy(Check); > > type Void is private with Type_Invariant => False; > > function Impossible return Void with Pre => False; > > private > > type Void is null record; > > end What; This approach maybe illustrates a point best: in which way does Ada's type system support detecting errors in a program early? Or is is SPARK's type system? Compile time will be best. It is tricky to explore empirically, though, since by experiments I have got two different bug boxes so far. On this account, I'm not sure if I can take 'Access of a function because seemingly doing so triggers testing theprecondition...