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-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!79g2000hsk.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: On pragma Precondition and types Date: Thu, 2 Oct 2008 08:02:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3818fb9e-4599-400d-aa01-431a0b7101fa@79g2000hsk.googlegroups.com> References: <48e4dc3b$0$6604$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1222959737 10651 127.0.0.1 (2 Oct 2008 15:02:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 2 Oct 2008 15:02:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 79g2000hsk.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2195 Date: 2008-10-02T08:02:16-07:00 List-Id: On Oct 2, 7:35 am, Georg Bauhaus wrote: > Suppose there is a type T with operations P and F, > > type T is private; > > procedure P (X: in out T); > function F (X: T) return Boolean; > > I want to add a precondition of P. The precondition > involves F, > > procedure P (X: in out T); > pragma Precondition (F(X)); > > function F (X: T) return Boolean; > > But when the compiler sees the pragma Precondition, > it has not yet seen F. Therefore, by the principle > of linear reading, the precondition cannot be compiled, > IIUC. > > Could there be a rule for pragmas, say, allowing forward > references? If you just heard a strange high-pitched noise, it was the sound of several dozen compiler maintainers reacting to your proposal in terror. Sort of the same sound Janet Leigh made in "Psycho"........ -- Adam