From: Adam Beneschan <adam@irvine.com>
Subject: Re: On pragma Precondition and types
Date: Thu, 2 Oct 2008 08:02:16 -0700 (PDT)
Date: 2008-10-02T08:02:16-07:00 [thread overview]
Message-ID: <3818fb9e-4599-400d-aa01-431a0b7101fa@79g2000hsk.googlegroups.com> (raw)
In-Reply-To: 48e4dc3b$0$6604$9b4e6d93@newsspool3.arcor-online.net
On Oct 2, 7:35 am, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
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
next prev parent reply other threads:[~2008-10-02 15:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 14:35 On pragma Precondition and types Georg Bauhaus
2008-10-02 15:02 ` Adam Beneschan [this message]
2008-10-02 23:09 ` Randy Brukardt
2008-10-02 23:09 ` Randy Brukardt
2008-10-03 8:59 ` Dmitry A. Kazakov
2008-10-03 9:35 ` Georg Bauhaus
2008-10-03 10:50 ` Dmitry A. Kazakov
2008-10-03 12:41 ` Georg Bauhaus
2008-10-02 23:09 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox