comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: On pragma Precondition and types
Date: Thu, 02 Oct 2008 16:35:39 +0200
Date: 2008-10-02T16:35:40+02:00	[thread overview]
Message-ID: <48e4dc3b$0$6604$9b4e6d93@newsspool3.arcor-online.net> (raw)

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? Or can these rules be tied to some suitable
constraint syntax?



             reply	other threads:[~2008-10-02 14:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 14:35 Georg Bauhaus [this message]
2008-10-02 15:02 ` On pragma Precondition and types Adam Beneschan
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
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