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 X-Google-Thread: 103376,585fd78267abd80c X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!postnews.google.com!q5g2000prf.googlegroups.com!not-for-mail From: mockturtle Newsgroups: comp.lang.ada Subject: Re: On pragma Precondition etc. Date: Fri, 25 Jul 2008 04:05:25 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4889886d$0$18827$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: 158.110.28.116 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1216983925 31362 127.0.0.1 (25 Jul 2008 11:05:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 25 Jul 2008 11:05:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q5g2000prf.googlegroups.com; posting-host=158.110.28.116; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 Galeon/1.2.11 (X11; Linux i686; U;) Gecko/20030708,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1323 Date: 2008-07-25T04:05:25-07:00 List-Id: stefan-lu...@see-the.signature ha scritto: > On Fri, 25 Jul 2008, Georg Bauhaus wrote: > > > We would have something like > > > > function More(X, Y: Integer); > > -- ... > > pragma Precondition(More, X > 2 * Y); > > > > > > function Less(X, Y: Integer); > > -- ... > > pragma Precondition(Less, X < 2 * Y); > > > > And now there is no doubt about the subprogram to which a > > Pre-/Postcondition belongs. (A rule that a spec Pre-/Postcondition > > pragma must come right after its subprogram will establish > > consistency.) > > This seems to break with overloading of subprogram names. I seem to recall > that > "pragma Inline(Foo)" > is asking to inlie *all* functions / procedures with the name "Foo". This > may be OK for inlining, but you definitively don't want to use the same > preconditions which happen to have the same way. Consider the following: What about _allowing_ for the name of the procedure to appear in the pragma? The true syntactic link would be given by the pragma position and the procedure name would act as a "double check" to be sure that things were not messed up. Of course this does not save you if you permute the pragma of overloaded functions... ---