comp.lang.ada
 help / color / mirror / Atom feed
* On pragma Precondition and types
@ 2008-10-02 14:35 Georg Bauhaus
  2008-10-02 15:02 ` Adam Beneschan
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Georg Bauhaus @ 2008-10-02 14:35 UTC (permalink / 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?



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-10-03 12:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-02 14:35 On pragma Precondition and types Georg Bauhaus
2008-10-02 15:02 ` Adam Beneschan
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox