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 X-Google-Thread: 103376,8ed772fe699ce43 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder.news-service.com!ramfeed2.eweka.nl!eweka.nl!lightspeed.eweka.nl!82.197.223.104.MISMATCH!feeder4.cambrium.nl!feed.tweaknews.nl!news.netcologne.de!newsfeed-hp2.netcologne.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 22 Oct 2008 01:48:42 +0200 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Require / ensure clauses References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <48fe6a5a$0$13389$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 22 Oct 2008 01:48:42 CEST NNTP-Posting-Host: 6ee5de72.newsspool4.arcor-online.net X-Trace: DXC=Ce3lRd7PBVT<<0iRN7DLEQ4IUK Hibou57 (Yannick Duch�ne) wrote: > ... here we are... let's simply talk about design by contract with > Ada :) Ada DbC seems to be work in progress, to be integrated possibly with Ada type constraints (yielding type based invariants in addition to pre/post for subprograms). At this time GNAT GPL offers a semi-solution for subprograms (excluding inheritance AFAICT). Use pragmas Precondition and Postcondition, specified next to the preceding subprogram declaration. Use pragma Assert for Eiffel's "check" instruction. Exception handlers can be made to act like Eiffel's "rescue" clauses. I'd speculate that adding constraints for types and operations is not an easy job because Ada is not as simple a language as Eiffel sometimes appears to be. At least as regards integration of Ada with DbC or with that other one, requires/modifies/ensures etc. If the SPARK subset of Ada is not a heavy restriction, it offers Eiffel DbC and more, at program analysis (compile) time. I think it was advertised it as Eiffel on Steroids once.