comp.lang.ada
 help / color / mirror / Atom feed
* Specifying the order of ops on an ADT with aspects
@ 2010-02-04 11:26 Georg Bauhaus
  2010-02-04 18:07 ` Hibou57 (Yannick Duchêne)
  0 siblings, 1 reply; 9+ messages in thread
From: Georg Bauhaus @ 2010-02-04 11:26 UTC (permalink / raw)


Defining a private type, I'd like to know whether
it is possible to specify, with the help of the new
aspects, possible orders of calling the operations.
Showing my ignorance, to which extent might it be
possible to analyse the order of calls at compile time?

(AI05-0145-{1,2}, AI05-0183)

generic
   type P is private;
package Order is


   pragma Pure (Order);
   -- ascertain that Pre functions do not have side effects




   type States is (S0, S1, S2, S3);

   type T is tagged private;

   function State_Of (Object : in T) return States;


   procedure Op1 (Object : in out T; Param : in P)
     with
       Pre => State_Of (Object) = S0;

   procedure Op2 (Object : in out T; Param : in P)
     with
       Pre => State_Of (Object) = S1 and Knoptuous (Object);

   procedure Op3 (Object : in out T; Param : in P)
     with
       Pre => State_Of (Object) in S1 .. S2;


   function Knoptuous (Object : in T) return Boolean;

private
   type T is tagged
      record
         State_Of : States := S0;
      end record;

end Order;




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

end of thread, other threads:[~2010-02-08 10:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04 11:26 Specifying the order of ops on an ADT with aspects Georg Bauhaus
2010-02-04 18:07 ` Hibou57 (Yannick Duchêne)
2010-02-05 16:44   ` Colin Paul Gloster
2010-02-05 16:55     ` Hibou57 (Yannick Duchêne)
2010-02-05 18:34       ` Dmitry A. Kazakov
2010-02-08 10:41         ` Colin Paul Gloster
2010-02-05 22:15   ` Randy Brukardt
2010-02-05 22:45     ` Hibou57 (Yannick Duchêne)
2010-02-06  3:35       ` Hibou57 (Yannick Duchêne)

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