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,585fd78267abd80c X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!t-online.de!storethat.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Fri, 25 Jul 2008 13:56:07 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: On pragma Precondition etc. References: <4889886d$0$18827$9b4e6d93@newsspool2.arcor-online.net> <6etsi6F8mbmbU2@mid.individual.net> In-Reply-To: <6etsi6F8mbmbU2@mid.individual.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4889bf57$0$9508$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 25 Jul 2008 13:56:07 CEST NNTP-Posting-Host: f32ce702.newsspool3.arcor-online.net X-Trace: DXC=mg6RjLh>_cHTX3jmhYoAMG56UJc X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:1327 Date: 2008-07-25T13:56:07+02:00 List-Id: Alex R. Mosteo schrieb: > Piling more suggestions: I understand the point of using pragmas by Gnat at > this stage, but if this is going to be standardized perhaps the syntax of a > declaration could be changed. For example: > > function Foo (X, Y : Something) return Whatever with > Precondition (Blah) and > Postcondition (Urgh); > > So now it is all a indivisible whole and the OP concern is gone. > > I haven't seen Eiffel code. How do they do this? feature Foo(X, Y : SOMETHING): WHATEVER is -- short comment require Precondition_Name: Blah do ... ensure Postcondition_Name: Urgh end The Pre-/Postcondition_Name serves a purpose similar to the message parameter of Ada's pragmas.) Eiffel's "contract view" of the class then hides the statements of Foo. So you get a "spec". feature Foo(X, Y : SOMETHING): WHATEVER is -- short comment require Precondition_Name: Blah ensure Postcondition_Name: Urgh In addition, Eiffel's Pre-/Postcondition have inheritance rules for the conditions. Another spot where Ada would to be more general. -- Georg Bauhaus Y A Time Drain http://www.9toX.de