From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,549562583b1942d9,start X-Google-Attributes: gid103376,public From: "Bernd Ragutt" Subject: exceptions and streams Date: 1998/10/30 Message-ID: #1/1 X-Deja-AN: 406843165 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada Date: 1998-10-30T00:00:00+00:00 List-Id: Hello, I tried to write (and read) exception occurrences to a stream; with the Gnat-Compiler I succeeded, with the Apex-Compiler I failed. I think there is a contradiction between RM 11.4.1 (16) and RM 13.13.2 (36). Any comments? Bernd Ragutt ---------------------- BerndRagutt@csi.com --******************************************************************* Ada95-Code Exceptions.Exception_Occurrence'Write (Stream => As_Excecption_Stream, Item => An_Exception_Occurrence); GNAT 3.10 / NT ... compiles and executes the code without an error message. Rational APEX 3.0 AIX >>> Line 37: Exceptions.Exception_Occurrence'Write (As_Excecption_Stream, An_Excecption_Occur); *** Exceptions.Exception_Occurrence'Write must be specified via an attribute definition RM 11.4.1 (16) The implementation of the Write attribute (see 13.13.2) of Exception_Occurrence shall [!!!] support writing a representation of an exception occurrence to a stream; the implementation of the Read attribute of Exception_Occurrence shall support reconstructing an exception occurrence from a stream (including one written in a different partition). RM 13.13.2 (2) For every subtype S of a specific type T, the following attributes [S�Write, S�Read] are defined. RM 13.13.2 (36) The stream-oriented attributes may be specified for any type via an attribute_definition_clause. All nonlimited types have default implementations for these operations. An attribute_reference for one of these attributes is illegal if the type is limited, unless the attribute has been specified by an attribute_definition_clause. For an attribute_definition_clause specifying one of these attributes, the subtype of the Item parameter shall be the base subtype if scalar, and the first subtype otherwise. The same rule applies to the result of the Input function. AI95-00047/03, 96-02-06 ... The wording of 13.13.2(2) is misleading. Limited types don't have a default implementation for the Read and Write attributes, per 13.13.2(36). Clearly 13.13.2(2) should be reworded to make it clear that although the attributes are in some sense "defined," it is illegal to evaluate them for limited types unless the user specifies them. ... --*******************************************************************