From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Specifying the order of ops on an ADT with aspects
Date: Thu, 04 Feb 2010 12:26:11 +0100
Date: 2010-02-04T12:26:12+01:00 [thread overview]
Message-ID: <4b6aaed4$0$7625$9b4e6d93@newsspool1.arcor-online.net> (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;
next reply other threads:[~2010-02-04 11:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 11:26 Georg Bauhaus [this message]
2010-02-04 18:07 ` Specifying the order of ops on an ADT with aspects 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)
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox