Rationale for Ada 2012

John Barnes
Contents   Index   References   Search   Previous   Next 

9.3.6 Type and package invariants

This defined further pragmas similar to those in the previous proposal but concerned with packages and types. Thus the pragma Package_Invariant proposed for Ada 2005 identified a function returning a Boolean result. This function would be implicitly called after the call of each subprogram in the package and if the result were false the behaviour would be as for an Assert pragma that failed.
This proposal was also abandoned for Ada 2005. However, Ada 2012 has introduced type invariants thus
type Stack is private
   with Type_Invariant => Is_Unduplicated(Stack);
as discussed in chapter 2, “Contracts and aspects”. On the other hand, package invariants remain abandoned.

Contents   Index   References   Search   Previous   Next 
© 2011, 2012, 2013 John Barnes Informatics.
Sponsored in part by:
The Ada Resource Association:

    ARA
  AdaCore:


    AdaCore
and   Ada-Europe:

Ada-Europe