CVS difference for ais/ai-00290.txt
--- ais/ai-00290.txt 2003/01/24 04:14:27 1.4
+++ ais/ai-00290.txt 2003/12/07 05:00:31 1.5
@@ -262,3 +262,63 @@
****************************************************************
+!topic implications of pragma pure for Ada.Assertions.Assert
+!reference RM95-10.2.1(18)
+!from Dan Eilers 03-10-16
+!keywords pragma pure assert
+
+The proposed assertions package in AI95-00286 uses pragma pure
+(apparently so that procedure Ada.Assertions.Assert can be called
+from pure packages).
+
+But this seems to imply an unintended implementation permission to omit
+all calls on this procedure, per RM 10.2.1(18), since Assert has only IN
+parameters. I am assuming that an exception being raised is considered
+a "side effect" rather than a "result" of the subprogram, although the
+RM doesn't seem to explicit say that.
+
+Perhaps there needs to be a mechanism to indicate that a subprogram might
+raise an exception, and calls should therefore not be omitted, unless
+perhaps they are successive calls with identical parameters.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Thursday, October 16, 2003 3:00 PM
+
+Good point. I would instead suggest that we change the wording
+of 10.2.1(18) to only apply to functions and to procedures with
+OUT parameters. The permission would not apply to calls on pure
+procedures with only IN parameters.
+
+****************************************************************
+
+From: Robert A. Duff
+Sent: Thursday, October 16, 2003 3:04 PM
+
+> But this seems to imply an unintended implementation permission to omit
+> all calls on this procedure, per RM 10.2.1(18), since Assert has only IN
+> parameters. I am assuming that an exception being raised is considered
+> a "side effect" rather than a "result" of the subprogram, although the
+> RM doesn't seem to explicit say that.
+
+Good point. I've never been very comfortable with the wording of this
+paragraph, by the way.
+
+> Perhaps there needs to be a mechanism to indicate that a subprogram might
+> raise an exception, and calls should therefore not be omitted, unless
+> perhaps they are successive calls with identical parameters.
+
+But surely a user-defined subp call cannot be silently omitted,
+just because it is known to raise an exception!? The AARM annotation
+talks about machine-code insertions and the like -- not well-defined
+standard stuff like exceptions.
+
+And I think the same about Assert -- if there aren't any pragmas or
+command-line switches turning it off, it ought to raise an exception
+when violated, just like array-index-out-of-bounds raises C_E.
+
+Or was this intended to be like 11.6?. I hope not...
+
+****************************************************************
+
Questions? Ask the ACAA Technical Agent