![]() |
Section 6.7.13: |
An assertion is a statement made by the writer of the program that, at the point in the code where the assert statement appears, the argument (a logical value) is true. If it should not be true then an exception is raised on the object involved.
This statement type makes use of the built-in routine with the 'Assert' identity. This is defined as in the following invariant -
The invariant above completely defines the well-formedness condition of an assert statement. The implementation is given below in the dynamic statement section.
The assertion statement raises an exception if the argument given is false, otherwise does nothing.
Note that this definition does not specify how the assertion is to be implemented. In practical terms it is, of course, the equivalent of
![]() |
Specification Index | ![]() |
Language Index | ![]() |
Section 6 Index |
Comments
or enquiries should be made to Keith
Hopper. Page last modified: Monday, 29 May 2000. |
![]() |